Add pre-commit#54
Conversation
|
As far as I know, only clang-format currently supports formatting of C. Personally, I think we don't need it, just like cpython doesn't use it yet. |
d8240b3 to
8ba3d2c
Compare
|
It's Looks fine! |
|
cc @skirpichev Look this ;) |
|
What C style do you prefer? GNU style? or kernel style? Maybe we need to write our own clang-format, but I want to hear your desired style for this project. |
8ba3d2c to
d1151a1
Compare
As this is a Python extension so far, I would choose PEP 7 style. Please note, that |
d1151a1 to
fb677d3
Compare
|
Alright, I will complete this PR in the near future. Currently, CPython does not strictly enforce PEP 7, as clang often cannot accurately describe it. However, I will try to make sure the code complies with PEP7 as much as possible, which may take some time. Please do not rush me. Especially to launch PR without notice, I need to reiterate this point. |
f4a118c to
57f73e2
Compare
|
Let us rejoice, now we have formatting tools! |
|
@skirpichev Please review them! |
skirpichev
left a comment
There was a problem hiding this comment.
So, some comments.
Sorry, I'm not sure how to improve things.
|
Maybe we should remove the style check of C. Clang cannot strictly implement PEP7, because it combines multiple practices. And CPython has no requirements for this, and only gives change requirements at the review stage. |
|
I think it should be removed. At least there are only you and me participating in the current project. We just need to abide by it. @skirpichev |
3d7f84a to
2112b4d
Compare
2112b4d to
74b368c
Compare
skirpichev
left a comment
There was a problem hiding this comment.
I think should also check *.yml and pyproject.toml.
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.x" | ||
| - uses: pre-commit/action@v3.0.1 |
There was a problem hiding this comment.
It's readme says: "this action is in maintenance-only mode". I don't think we should depend on obsoleted project.
| - id: ruff | ||
| name: Run ruff on tests/ | ||
| args: [--exit-non-zero-on-fix] | ||
| files: ^tests/ |
There was a problem hiding this comment.
We should check all files, like current "test" action does. BTW, ruff test in the test.yml now redundant and should be removed.
|
Valuable suggestions, I will revise them. |
|
See #82 |
No description provided.