Add pre-commit and bunch of autofixes support#2034
Merged
mhammond merged 3 commits intomhammond:mainfrom Mar 14, 2024
Merged
Conversation
Avasam
commented
Mar 25, 2023
| # A clang-format style that approximates Python's PEP 7 | ||
| # Useful for IDE integration | ||
| BasedOnStyle: Google | ||
| AlwaysBreakAfterReturnType: All |
Collaborator
Author
There was a problem hiding this comment.
It found a duplicate entry!
Avasam
commented
Mar 25, 2023
| * | ||
| * MAPI OID definition header file | ||
| * | ||
| * Copyright (c) 2009 Microsoft Corporation. All Rights Reserved. |
Collaborator
Author
There was a problem hiding this comment.
It found an extra carriage return and fixed line endings
Owner
There was a problem hiding this comment.
We should exclude these "vendored" files though?
Avasam
commented
Mar 25, 2023
c4463fa to
9e5adab
Compare
9e5adab to
7194628
Compare
mhammond
requested changes
Mar 14, 2024
Owner
mhammond
left a comment
There was a problem hiding this comment.
Thanks, but files copied in from external sources should be excluded from these rules.
| * | ||
| * MAPI OID definition header file | ||
| * | ||
| * Copyright (c) 2009 Microsoft Corporation. All Rights Reserved. |
Owner
There was a problem hiding this comment.
We should exclude these "vendored" files though?
…ommit.ci-autofixes
… mixed-line-ending
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Here's the "magically autofixing on pull-request" I was talking about.
You install
pre-commitlocally withpip install pre-commitand run it locally usingpre-commit run [--all-files](without--all-filesit only runs on changed files, which is what would happen on the CI).You can still run all commands individually if you feel like it (like
black .)Added autoformatting for toml, yaml and ini files as well (not json cuz there's none in this project).
Autofixes for mixed-line-ending, case-conflict trailing whitespaces and end-of-file newline. Although I didn't activate those last two because it'd create a massive commit, better keep that for it's own, easily ignorable from history.
Users who enjoy pre-commit git hooks (I don't, some do), can also now use this as a pre-commit hook on their own accord.
If this is accepted, the next step would be to sign-in on https://pre-commit.ci/ and connect it to this repo. (it's the CI autofixes version of https://pre-commit.com)