-
Notifications
You must be signed in to change notification settings - Fork 43
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
Implement code style via pre-commit #264
Conversation
Some of us were using it locally. I guess it means installing these other tools locally instead. You will have to fix up the ci.yml pipeline as well, since it is depending on flake8 right, and run precommit now? |
From private discussion with @seanpearsonuk, he pointed the usage of "pylint" locally, as @dnwillia-work explained in previous comment too. Knowing this, my suggestion is to keep the usage of "pylint" and move its configuration from "pylintrc -> .pylintrc", see official pylint docs. |
I will also modify the CI actions to work with pre-commit, @dnwillia-work. |
a8e69b0
to
935b28f
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.
Jorge, it looks ok though I wonder if it's worth reformatting all the generated code:
- everything in api.fluent.v0
- interface defined by fluent.core.meshing.tui.
- interface defined by fluent.core.solver.tui.
- interface defined by fluent.core.solver.settings
The first one is generated using grpcio tools, the latter three are generated using codegen/tuigen.py and codegen/settingsgen.py accordingly. The codegen tools should probably be updated to use correct formatting but if that's not easy then I guess we could rely on the code formatter to deal with it.... Maybe you can call the code formatter explicitly after the fact in the codegen modules?
Thanks for pointing this out, @dnwillia-work. I agree with excluding automated code from the formatting. It is true that we could execute the formatting tools in the last step of the codegen/*gen.py files, but this would introduce another source of maintenance instead of having all format config under the |
5a9e794
to
10a85d4
Compare
This issue psf/black#438 delayed me a bit when excluding files in |
b44372d
to
7d9580f
Compare
Already setup black, isort and flake8. Still working on the codespell and pydocstyle tools for excluding desired files... ⚙️ |
904672f
to
30aaefe
Compare
Only task left before labeling this as "Ready for review" is to manually apply code style for flake8, codespell and pydocstyle. This last is going to be most tedious one. I guess we could ignore some of the most common error codes. |
30aaefe
to
008a772
Compare
00e9b56
to
d06e0ed
Compare
Even though I setup [pydocstyle], I finally decided to disable it by commenting its lines in the What do you think, @seanpearsonuk @dnwillia-work @mkundu1? |
Resolves #261.