-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gracefully handle Git deletions again #137
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work 👍 extensive tests as well :)
|
||
(assert (-> deletable-file .exists)) | ||
|
||
(assert (not (-> createable-filename File. .exists))) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be inside of the test. The files don't have to exist/not-exists when loading this ns, they should when i run the tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be inside of the test.
Note that 2 deftests depend on this assertion. Having 2 deftests fail seems less clear, concise and immediate than having (refresh)
fail as soon as an issue arises.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except that now i can refresh, delete the file and run the test. yielding unclear failures as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except that now i can refresh, delete the file and run the test.
Running tests without a prior (refresh)
seems just wrong. Our dev.clj file typically suggests to (refresh)
prior to running any test
Ready again! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
during QA i noticed that absolutize might not work as expected in monorepos:
The module
part is missing from the path. (e.g. project-dir/src
is used instead of project-dir/module/src
)
👀! Did you get exceptions? Supposedly there's a spec that would assert |
It's probably happening when |
(For clarity: at least the spec checking part was working, w/ nice Expound reports) |
Only the
|
Some notes:
The latter, beng different, is a source of issues. |
This makes `ls-files` option more analog to that of `diff --name-status` and `status --porcelain`, in that it is independent from the current directory (which is relevant for monorepos)
Kindly QA again. I'll be also, over a non-monorepo |
staged/unstaged deleted files within the same module work as expected. However |
I thought about that. It seems bit of a poor default to return files outside of the monorepo. Most folks will not want files outside of the current project to be returned. Else they will be formatting/linting files outside of what Clojure can That's a non-issue for us with the (Even among us :monorepo is optional) |
This is not necessarily true, the files might be on the classpath, but not in the current project. It might be specific to our monorepo setup, but running |
Yes, but we cannot know with all certainty. (Monorepo != "all projects can reach each other's set of namespaces") Created #139 + #140 btw, which can be attended promptly but would not consider a blocker (as f-s is somewhat broken rn) |
Brief
impl/absolutize
, particularly with its.exists
assertion, had broken our ability to gracefully handle deleted files (staged or not).This PR fixes that, adding an extensive integration test.
QA plan
Test all cases in a real project (suggestion: a monorepo):
core/format!
,format-and-lint-project!
,format-and-lint-branch!
That's 6 scenarios - please let's test them all (I have in formatting-stack itself).
Author checklist
defn all-files
peforms 3 git ops but they're fairly cheap (5-15ms each)Reviewer checklist