-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH: implement code style via pre-commit (#264)
* Remove requirements_style.txt * New .pre-commit-config.yaml * Move pylintrc -> .pylintrc * Update CI to run pre-commit * Update Makefile to run pre-commit * Exclude autogenerated files from code formatting * Apply code style * Update style docs * Disable pydocstyle * Apply codestyle Co-authored-by: Jorge Martinez <[email protected]>
- Loading branch information
1 parent
e6900ed
commit 50d13fc
Showing
59 changed files
with
815 additions
and
796 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,14 +27,14 @@ jobs: | |
with: | ||
python-version: 3.9 | ||
|
||
- name: Install Style Requirements | ||
- name: Install pre-commit | ||
run: | | ||
pip install -r requirements_style.txt --disable-pip-version-check | ||
python -m pip install pre-commit | ||
- name: Run flake8 | ||
- name: Run pre-commit | ||
if: always() | ||
run: | | ||
make flake8 | ||
pre-commit run --all-files --show-diff-on-failure | ||
- name: Run protolint | ||
uses: plexsystems/[email protected] | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
repos: | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 22.3.0 | ||
hooks: | ||
- id: black | ||
args: [ | ||
--line-length, "79", | ||
--force-exclude, ansys/api/fluent/v0/|ansys/fluent/core/meshing/tui.py|ansys/fluent/core/solver/tui.py|ansys/fluent/core/solver/settings.py, | ||
ansys, codegen, doc, examples, tests | ||
] | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
args: [ | ||
--profile, black, | ||
--skip, ansys/fluent/core/meshing/tui.py, | ||
--skip, ansys/fluent/core/solver/tui.py, | ||
--skip, ansys/fluent/core/solver/settings.py, | ||
--skip-glob, ansys/api/fluent/v0/*, | ||
--force-sort-within-sections, | ||
--line-length, "79", | ||
--section-default, THIRDPARTY, | ||
--filter-files, | ||
ansys, codegen, doc, examples, tests | ||
] | ||
|
||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 4.0.1 | ||
hooks: | ||
- id: flake8 | ||
args: [ | ||
--exclude, ansys/api/fluent/v0/* ansys/fluent/core/meshing/tui.py ansys/fluent/core/solver/tui.py ansys/fluent/core/solver/settings.py, | ||
--select, W191 W291 W293 W391 E115 E117 E122 E124 E125 E225 E231 E301 E303 F401 F403 N801 N802 N803 N804 N805 N806, | ||
--count, | ||
--statistics, | ||
--max-complexity, "10", | ||
--max-line-length, "79", | ||
ansys, codegen, doc, examples, tests | ||
] | ||
|
||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.1.0 | ||
hooks: | ||
- id: codespell | ||
args: [ | ||
--skip, "ansys/api/fluent/v0/*,ansys/fluent/core/meshing/tui.py,ansys/fluent/core/solver/tui.py,ansys/fluent/core/solver/settings.py", | ||
] | ||
|
||
- repo: https://github.com/myint/docformatter | ||
rev: v1.3.1 | ||
hooks: | ||
- id: docformatter | ||
exclude: ^(tests\/|ansys\/api\/fluent\/v0\/|ansys\/fluent\/core\/meshing\/tui.py|ansys\/fluent\/core\/solver\/tui.py|ansys\/fluent\/core\/solver\/settings.py) | ||
args: [-r, --in-place] | ||
|
||
#- repo: https://github.com/pycqa/pydocstyle | ||
# rev: 6.1.1 | ||
# hooks: | ||
# - id: pydocstyle | ||
# additional_dependencies: [toml] | ||
# exclude: ^(tests\/|ansys\/api\/fluent\/v0\/|ansys\/fluent\/core\/meshing\/tui.py|ansys\/fluent\/core\/solver\/tui.py|ansys\/fluent\/core\/solver\/settings.py) | ||
# args: [ | ||
# # Error codes: http://www.pydocstyle.org/en/stable/error_codes.html | ||
# --ignore, "D107,D105,D4", | ||
# --count, | ||
# ] |
File renamed without changes.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.