Skip to content

Commit

Permalink
Add Ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Dec 3, 2024
1 parent 2f733d3 commit 46fc010
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 50 deletions.
3 changes: 0 additions & 3 deletions .bandit.yaml

This file was deleted.

29 changes: 7 additions & 22 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,39 +61,24 @@ repos:
rev: v0.1.8
hooks:
- id: ripsecrets
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.1
hooks:
- id: autoflake
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
hooks:
- id: pyupgrade
args:
- --py39-plus
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
# isort issue: https://github.com/PyCQA/isort/issues/1889
- id: ruff-format
args:
- --project=c2cwsgiutils
- repo: https://github.com/psf/black
rev: 24.10.0
hooks:
- id: black
exclude: .*\.html
- --line-length=110
- repo: https://github.com/PyCQA/prospector
rev: v1.13.3
hooks:
- id: prospector
args:
- --tool=pydocstyle
- --tool=ruff
- --die-on-tool-error
- --output-format=pylint
additional_dependencies:
- prospector-profile-duplicated==1.8.0 # pypi
- prospector-profile-utils==1.12.2 # pypi
- prospector-profile-utils==1.13.0 # pypi
- ruff==0.8.1 # pypi
- repo: https://github.com/sbrunner/jsonschema-validator
rev: 0.3.2
hooks:
Expand Down
25 changes: 2 additions & 23 deletions .prospector.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
inherits:
- utils:base
- utils:no-design-checks
- utils:c2cwsgiutils
- utils:fix
- utils:unsafe
- duplicated

doc-warnings: true

ignore-paths:
- docs
- acceptance_tests
Expand All @@ -16,24 +16,3 @@ pylint:
extension-pkg-allow-list:
- ujson
- lxml
disable:
- no-else-return
- no-else-raise
- missing-module-docstring
- missing-timeout # A default timeout is set

pydocstyle:
disable:
- D104 # Missing docstring in public package
- D105 # Missing docstring in magic method
- D107 # Missing docstring in __init__

pycodestyle:
disable:
# Buggy checks with Python 3.12
- E221 # multiple spaces before operator
- E702 # multiple statements on one line (semicolon)

bandit:
options:
config: .bandit.yaml
30 changes: 29 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ test_images = ["scikit-image"]

[tool.poetry.group.dev.dependencies]
# pylint = { version = "2.15.6" }
prospector = { extras = ["with_bandit", "with_mypy", "with_pyroma"], version = "1.13.3" }
prospector = { version = "1.13.3", extras = ["with_bandit", "with_mypy", "with_pyroma", "with_ruff"] }
prospector-profile-duplicated = "1.8.0"
prospector-profile-utils = "1.14.0"
coverage = "7.6.8"
Expand Down

0 comments on commit 46fc010

Please sign in to comment.