GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — GH-109408: Move the C file whitespace check from patchcheck to pre-commit by AA-Turner · Pull Request #109890 · python/cpython Conversation
|
|
We could change it to run A |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I vote for the latter -- code golf is fun but pretty unmaintainable ;) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Done, I've just reused A |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
|
||
| if __name__ == '__main__': | ||
| main() | ||
| raise SystemExit(main()) |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
process() now has return values, which go to main(), but main() always returns None so we never get any errors here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Oh, I didn't realise! pre-commit was failing in my local testing when I introduced tabs, perhaps it just fails when a file is changed after the hook has run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| name: "Check C file whitespace" | ||
| entry: "python Tools/patchcheck/untabify.py" | ||
| language: "system" | ||
| types_or: ['c', 'c++'] |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
We were running on .c and .h files before:
c_files = [fn for fn in file_paths if fn.endswith(('.c', '.h'))]
Both of those are matched by the c type, so this would be closer to parity:
| types_or: ['c', 'c++'] | |
| types_or: [c] |
We do have half a dozen .cpp files in the codebase, do we want to expand to include them? Should we also add c++ for trailing-whitespace above?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The test passed with 'c++' included, I imagined that it was a previous oversight that they weren't included. I'll check if the trailing whitespace check also passes.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp fails with 16 lines changed. Other than that all good (@zooba would you be alright with us enabling the trailing whitespace check here? No real views either way, if you'd prefer to keep the whitespace then that's the status quo anyway!)
A
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
(We can always remove c++ later if needed.)
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| if has_c_files: | ||
| print("Did you run the test suite and check for refleaks?") | ||
| elif python_files: | ||
| print("Did you run the test suite?") |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
It's so much clearer like this! 👍
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@AA-Turner Looks good, please could you resolve the conflict? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
# Conflicts: # Tools/patchcheck/patchcheck.py
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @AA-Turner for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @AA-Turner for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @AA-Turner and @hugovk, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @AA-Turner and @hugovk, I could not cleanly backport this to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…eck to pre-commit (pythonGH-109890) Co-authored-by: Hugo van Kemenade <[email protected]> (cherry picked from commit f5edb56) Co-authored-by: Adam Turner <[email protected]>
|
GH-110636 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…eck to pre-commit (pythonGH-109890) Co-authored-by: Hugo van Kemenade <[email protected]>. (cherry picked from commit f5edb56) Co-authored-by: Adam Turner <[email protected]>
|
GH-110640 is a backport of this pull request to the 3.11 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…pre-commit (python#109890) Co-authored-by: Hugo van Kemenade <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.