-
Notifications
You must be signed in to change notification settings - Fork 791
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
Add pre-commit and bunch of autofixes support #2034
Conversation
@@ -1,7 +1,6 @@ | |||
# A clang-format style that approximates Python's PEP 7 | |||
# Useful for IDE integration | |||
BasedOnStyle: Google | |||
AlwaysBreakAfterReturnType: All |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It found a duplicate entry!
* | ||
* MAPI OID definition header file | ||
* | ||
* Copyright (c) 2009 Microsoft Corporation. All Rights Reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It found an extra carriage return and fixed line endings
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should exclude these "vendored" files though?
c4463fa
to
9e5adab
Compare
9e5adab
to
7194628
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should exclude these "vendored" files though?
…ommit.ci-autofixes
… mixed-line-ending
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Here's the "magically autofixing on pull-request" I was talking about.
You install
pre-commit
locally withpip install pre-commit
and run it locally usingpre-commit run [--all-files]
(without--all-files
it 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)