Skip to content
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

Merged
merged 4 commits into from
Oct 21, 2020
Merged

Conversation

ghost
Copy link

@ghost ghost commented Oct 21, 2020

And format fewer Haskell and Scala files when not fully rebased from trunk.

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

@ghost ghost requested review from cocreature and garyverhaegen-da October 21, 2020 09:33
@ghost
Copy link
Author

ghost commented Oct 21, 2020

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 hlint.

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 ]])"
Copy link
Contributor

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?

Copy link
Author

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.

Copy link
Author

@ghost ghost Oct 21, 2020

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ghost ghost requested a review from garyverhaegen-da October 21, 2020 10:33
@ghost ghost added the automerge label Oct 21, 2020
@mergify mergify bot merged commit 903f7b9 into master Oct 21, 2020
@mergify mergify bot deleted the samir/hlint-diff branch October 21, 2020 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants