precommit: enable `end-of-file-fixer` by Borda · Pull Request #1920 · gitpython-developers/GitPython
Repository navigation
precommit: enable end-of-file-fixer - #1920
Merged
Byron merged 3 commits into gitpython-developers:main from Borda:precommit/end-of-file-fixer Jul 17, 2024
Merged
precommit: enable end-of-file-fixer #1920
Byron merged 3 commits into
gitpython-developers:main from
Borda:precommit/end-of-file-fixer
Conversation
Borda commented May 30, 2024
Copy link Copy Markdown
Contributor
let's formalize suggestion from #1888 (comment)
Borda added 2 commits May 30, 2024 12:22
precommit: enable end-of-file-fixer
9e67138
apply
96e21f0
Borda
mentioned this pull request
May 30, 2024
lint: add typos check
#1888
Merged
EliahKagan
requested changes
May 30, 2024
View reviewed changes
EliahKagan left a comment · edited Loading
Copy link Copy Markdown
Member
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more .
Although I think the underlying concept here is good, either all or all but one of the changes inside test/fixtures should be omitted.
Most files in test/fixtures are test data. Test data should rarely if ever modified for stylistic reasons, because it can break tests, including in ways whose impact would only occur in the case of a regression that a test would otherwise catch. In other words, changing test data without fully and carefully examining exactly how that change might relate to each use of the data in the tests can cause tests to break in ways that running the tests does not reveal.
The changes here do break the tests. Fortunately, they break them in a way that is easy to catch: a test fails that is supposed to pass. They may or may not also break the tests in other ways that are not easy to catch, i.e., that don't affect their status now, but that make the tests pass in slightly more circumstances than they should, thereby weakening them against future inadvertent bugs.
In the case of test/fixtures/.gitconfig, it may be worthwhile to look into this and maybe make the change anyway, since that file is not just used as a fixture: it is also used to configure CI. In the case of all other files in the test/fixtures directory that are modified here, I do not think there is sufficient benefit to justify the added time and effort that it would take to achieve a reasonable level of confidence that the changes would not cause any tests to continue passing in any circumstances under which they should start failing.
Although no *.py files inside test/fixtures are changed here, those files, while they are considered fixtures, are not test data, so I think it is fine to perform these kinds of stylistic checks and fixes on them. Other files in test/fixtures, with the possible exception of test/fixtures/.gitconfig, really should not be subject to these kinds of checks or receive these kinds of changes.
See also #1888 (comment) .
The changes outside of test/fixtures, including the automated changes in doc/source, all look good to me.
validate-pyproject
#1921
Merged
Byron
requested changes
May 31, 2024
View reviewed changes
Byron left a comment
Copy link Copy Markdown
Member
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more .
Thanks for the initiative!
I am now officially setting this PR to a state that indicates that some modifications are needed.
exclude: test/fixtures/
366a607
Borda commented Jul 16, 2024
Copy link Copy Markdown
Contributor
Author
reverted the changes in |
View reviewed changes
EliahKagan left a comment
Copy link Copy Markdown
Member
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more .
LGTM
Borda commented Jul 16, 2024
Copy link Copy Markdown
Contributor
Author
|
@Byron mind have a look again pls |
View reviewed changes
Byron left a comment · edited Loading
Copy link Copy Markdown
Member
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more .
Thanks a lot!
Byron merged commit3d3c86c
into
gitpython-developers : main
Jul 17, 2024
Borda
deleted the
precommit/end-of-file-fixer
branch
July 17, 2024 09:46
Sign up for free
to join this conversation on GitHub .
Already have an account?
Sign in to comment