-
Notifications
You must be signed in to change notification settings - Fork 205
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
fmt: Do not try and format missing Haskell files. #7759
Conversation
CHANGELOG_BEGIN CHANGELOG_END
Spotted this when trying to open a PR against the 1.6 release branch. This was trying to pass a file that didn't exist on that branch to |
fmt.sh
Outdated
hlint -j4 $changed_haskell_files | ||
fi | ||
# We do not run on deleted files, or files that have been added since we last rebased onto trunk. | ||
changed_haskell_files="$(git diff --name-only --diff-filter=d "$(git merge-base origin/master HEAD)" | grep '\.hs$' || [[ $? == 1 ]])" |
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.
Any opinion on --diff-filter=AM
?
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'm fine with that. It has the added benefit of not running on untracked files, which shouldn't be a problem.
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.
We probably want --diff-filter=ACMRT
. Copied files, renamed files, and type-changed files will all get checked in and need to be scanned.
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.
👍
And format fewer Haskell and Scala files when not fully rebased from trunk.
Pull Request Checklist
CHANGELOG_BEGIN
andCHANGELOG_END
tagsNOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.