Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is how I've always wished the
--dirty
flag worked.pint --dirty
will lint staged and unstaged files (and possibly untracked?). But once a file is committed, it will not be touched again bypint --dirty
, whether or not it passes. The only time it will be linted is when we run pint on the whole project again.This also means that running
pint --dirty
in CI is pointless, since all the files have already been committed, meaning we'll lint nothing. But running Pint without any flags can take upto five minutes in a large project, and that feedback cycle sucks.pint --diff=main
will collect all committed, staged, unstaged, and untracked files that differ from the provided branch. Meaning that if we've got a PR that only touches 5 files, we can now runpint --diff=main
in CI, and we're only going to look at those 5 files, saving a ton of time.We can also use this effectively locally. If your regular workflow is to create a branch from within a new issue, then check that branch out locally, your
main
branch might not be up to date withorigin
. Runningpint --diff=main
might not give you the results you'd expect then. However usingpint --diff=origin/main
can help speed up your feedback cycle dramatically.Note
I added a new method to the
PathsRepository
contract, which could be considered a breaking change.Here's the commit to revert if you need to:
git revert e295403a66c145e9b5530d3e5f9614875fc90162