-
Notifications
You must be signed in to change notification settings - Fork 31
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
Action to enforce python formatting #273
Conversation
Signed-off-by: 2byrds <[email protected]>
Signed-off-by: 2byrds <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #273 +/- ##
==========================================
+ Coverage 93.06% 93.10% +0.04%
==========================================
Files 36 36
Lines 7121 7221 +100
==========================================
+ Hits 6627 6723 +96
- Misses 494 498 +4 ☔ View full report in Codecov by Sentry. |
Signed-off-by: 2byrds <[email protected]>
…r with a comment Signed-off-by: 2byrds <[email protected]>
Signed-off-by: 2byrds <[email protected]>
Signed-off-by: 2byrds <[email protected]>
I think this is solving the wrong problem. Rather than "reformatting" the entire repo, making future diffs unintelligible, I'd rather see a GitHub action that enforces the current format, rather than switching formats entirely. |
@m00sey what is the current format(er)? |
@m00sey I've updated the title, the action only checks the formatting now (enforcing well formatted PRs). It does not try to format it for you any longer. That was discussed on #271 and I had updated it earlier today when I realized that auto-formatting was overkill. |
The current formatting checks are in the CI file: keria/.github/workflows/python-app-ci.yml Line 35 in c83904d
Anything proposed down this route should start here. E9: Syntax Errors - These errors occur when there is an issue with the syntax in the Python code, such as a missing colon, unmatched parentheses, or other fundamental syntax mistakes. Ignoring: |
The enabled rules wouldn't help enforce formatting issues for PRs. It is leveraging the syntax linting checks for flake8, and not providing formatting checks. To help distinguish between linters and formatters this is a decent quick read https://py-vscode.readthedocs.io/en/latest/files/linting.html Note that signify-ts checks formatting and linting: |
Okie - just trying to give you a jumping off point. You managed to create PRs without mass reformatting previously - https://github.com/WebOfTrust/keria/pull/254/files Maybe you should just go back to that workflow? Seems like that would expedite the merging process. |
Signed-off-by: 2byrds <[email protected]>
Signed-off-by: 2byrds <[email protected]>
I'm not sure what you mean. We want to avoid formatting from polluting PRs now and in the future. If we agree on a formatter than that can be easily checked. I have updated this PR to use autopep8 python formatter since @pfeairheller noted he uses PEP in IntelliJ. You can see what the output would look like on the latest formatting check for this PR. I still have no preference of what formatter to use, only that we make formatting simple now and in the future. |
Introduce a github action to check python formatting for all PRs being submitted to main, in order to align formatting.