Skip to content

Commit

Permalink
Update ruff action and pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
erichlf committed Jan 22, 2025
1 parent 8b0f314 commit 68ed621
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ jobs:
- name: Run python linting
uses: chartboost/ruff-action@v1
with:
args: --check .
config: pyproject.toml
changed-files: true
- name: Run unit tests
uses: ros-industrial/industrial_ci@master # run industrial_ci
env: # either pass all entries explicitly
Expand Down
50 changes: 42 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,44 @@
[tool.ruff]
line_length = 99
[tool.black]
line-length = 99
[tool.isort]
atomic = true
profile = "black"
line_length = 99
[tool.pep257]
ignore = "D100, D101, D102, D103, D104, D105, D106, D107, D203, D212, D404"
# industrial_ci gets cloned to the root of the repository in the ci/cd pipeline
extend-exclude = [".industrial_ci"]

[tool.ruff.lint]
select = [
# pydocstyle: check for docstring conventions
"D",
# pycodestyle: check PEP 8 code style conventions
"E",
# pyflakes: check for various errors (e.g. unused imports or variables)
"F",
# pyupgrade: check for old syntax in newer python versions
"UP",
# flake8-bugbear: check for bugs and design problems (e.g. using mutalble data structures as defaults)
"B",
# flake8-simplify: check for basic code simplifications
"SIM",
# isort: import sorting
"I",
]

extend-select = [
# enable D213 on top of the Google convention
# more pretty than D212
"D213"
]

ignore = [
# disable "missing docstring in public package" error
# already done in setup.py
"D104",
# disable "multi-line docstring summary should start at the first line" error
# ugly! and using alternative (D213) instead
"D212",
# disable: "missing argument description in the docstring"
# overkill for simple functions with descriptive argument names
"D417"
]

[tool.ruff.lint.pydocstyle]
# limit `pydocstyle` rules to those that adhere to the Google convention
convention = "google"

0 comments on commit 68ed621

Please sign in to comment.