-
Notifications
You must be signed in to change notification settings - Fork 3
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
[#200] Warnings about files that weren't added to git yet #215
[#200] Warnings about files that weren't added to git yet #215
Conversation
860c847
to
1476bd3
Compare
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.
Thanks, looks very good to me 👍
I would like to take another look after rebase.
src/Xrefcheck/Scan.hs
Outdated
location = | ||
if root `equalFilePath` "." | ||
then "" | ||
else dropTrailingPathSeparator root |
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.
After all, getUntrackedFiled
half-duplicates readDirectoryWith
, right?
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.
Removed code duplication in last commit
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.
In this regard, do you plan to retain the last commit or squash it afterward?
I like how it is put separately, but it contains a lot of changes to the first commit and this is not good.
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.
I was going to retain it, but now see problem you mentioned, so I will better move some changes between commits during interactive rebase (I'll write here when done)
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.
Cool, will wait for your message.
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.
@Martoon-00 done
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.
Thank you, looks good 👍
Also, as we discussed in Slack, let's add an option (probably a command line option?) to treat untracked git files as already added. FTR, my use case is sanity-checking auto-generated markdown documentation which we have in Morley. |
e46f4a8
to
6ad13ae
Compare
Done, also rebased on master |
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.
Looks very good to me 👍
I have mostly cosmetic concerns, and likely that will be it.
Oh and just in case (I wanted to mention this, but didn't expect you to read my messages close to Sunday's midnight 😅): this all is absolutely fine to fix some later (Monday/Tuesday), no hurry is needed. Unless you have a wish and opportinity to work on it right now 🙂 |
Of course, I am just checking github notifications to understand choices of tasks for tomorrow |
02967fe
to
24c3bd9
Compare
In the second commit, you seem to have no subject, it immediately starts from the description. Probably this accidentally happened during rebase? Aside from that, LGTM. |
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.
One last nitpick from my side remains, but I preliminarily approve, feel free to merge after fixing that.
Problem: after 0.2.2 release, xrefcheck cares only about files that were added to Git. That can be confusing for users (see #200) Solution: If a scannable (currently it means markdown) file is not ignored (by git or via config) and not tracked by git, print a warning to stderr while scanning repo. If a link target such file, change error message from "file not exists" to `Link target is not tracked by Git` Suggest user to run "git add" before running xrefcheck in both cases. To do this, I've changed the `RepoInfo` type, so it also contains information about untracked files now.
Problem: xrefcheck checks only files that are tracked by Git, but sometimes we want to run xrefcheck on files without adding them to Git, e.g. when we want to test some generator of markdown files or when we actively create markdown files during development. Solution: add option to treat files that were neither added to git nor ignored as existing.
24c3bd9
to
1c0fbfe
Compare
Description
Problem: after 0.2.2 release, xrefcheck cares only about files that were added to Git. That can be confusing for users (see #200)
Solution:
If a scannable (currently it means markdown) file is not ignored (by git or via config) and not tracked by git, print a warning to stderr while scanning repo.
If a link target such file, change error message from "file not exists" to
Link target is not tracked by Git
Suggest user to run "git add" before running xrefcheck in both cases.
To do this, I've changed the
RepoInfo
type, so it also contains information about untracked files now.Also add CLI option 1--include-untracked` to treat such files as existing.
Related issue(s)
Fixes #200
✅ Checklist for your Pull Request
Ideally a PR has all of the checkmarks set.
If something in this list is irrelevant to your PR, you should still set this
checkmark indicating that you are sure it is dealt with (be that by irrelevance).
Related changes (conditional)
Tests
silently reappearing again.
Documentation
Public contracts
of Public Contracts policy.
and
Stylistic guide (mandatory)