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

Trim trailing whitespaces and update pre-commit config to include "trailing-whitespace" #1171

Merged
merged 2 commits into from
Jan 13, 2024

Conversation

jcfr
Copy link
Member

@jcfr jcfr commented Jan 13, 2024

Consistently avoiding trailing whitespaces is helpful to avoid "false differences" and ensure all diffing tools show the "real" changes by default.

By adding trailing-whitespace to the pre-commit configuration, it enables the following:

  • GitHub Action report: Suggested changes are reported in the error log associated with the pre-commit GitHub Action workflow.

  • Consolidated local pre-commit checks and updates by running:

    pre-commit run --all-files
    

Adapted from:


Once this is integrated we will add the commit STYLE: Trim trailing whitespaces to .git-blame-ignore-revs1 as it was one:

Footnotes

  1. https://github.com/Slicer/Slicer/blob/main/.git-blame-ignore-revs

Consistently avoiding trailing whitespaces is helpful to avoid
"false differences" and ensure all diffing tools show the "real"
changes by default.
By adding `trailing-whitespace` to the pre-commit configuration, it enables the following:
* GitHub Action report: Suggested changes are reported in the error log associated with the pre-commit GitHub Action workflow.
* Consolidated local pre-commit checks and updates by running:

  ```
  python -m pip install pyupgrade

  python -m pre_commit run --all-files
  ```
@jcfr jcfr enabled auto-merge (rebase) January 13, 2024 17:04
@jcfr jcfr merged commit 3944cc8 into commontk:master Jan 13, 2024
3 checks passed
@jcfr jcfr deleted the strip-trailing-whitespaces branch January 13, 2024 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant