Skip to content

Commit

Permalink
chore: update ruff and replace black
Browse files Browse the repository at this point in the history
  • Loading branch information
jsolaas committed Aug 26, 2024
1 parent 6243717 commit a2a3e03
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
15 changes: 4 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,16 @@
# to avoid issues with RH 7
default_language_version:
node: 16.15.1
default_stages:
- "pre-commit"
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.0.278'
rev: 'v0.6.1'
hooks:
- id: ruff
files: ^src/.*\.py$
exclude: gen/|\.git|\.hg|\.mypy_cache|\.tox|\.venv|_build|buck-out|build|dist
args:
- --fix
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
language_version: python3
args: ['--line-length=120', '--include=\.pyi?$']
exclude: gen/
- id: ruff-format
- repo: https://github.com/codespell-project/codespell
rev: v2.2.4
hooks:
Expand All @@ -41,7 +33,7 @@ repos:
- types-requests
- pandas-stubs
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v9.5.0
rev: v9.16.0
hooks:
- id: commitlint
stages: [commit-msg]
Expand All @@ -57,4 +49,5 @@ repos:
rev: v3.63.2
hooks:
- id: trufflehog
stages: ["pre-commit"]
entry: trufflehog git file://. --since-commit HEAD --fail -x .trufflehogignore
13 changes: 7 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ check_untyped_defs = true

no_implicit_reexport = true


warn_no_return = false
disable_error_code = ["call-overload", "union-attr", "valid-type", "return-value", "attr-defined", "assignment"]
namespace_packages = true
Expand All @@ -122,6 +121,10 @@ omit=["^./__init__.py", "^api/.*"]

include = ["*.py", "*.pyi", "**/pyproject.toml", "*.ipynb"]

target-version = "py38"
line-length = 120

[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
Expand All @@ -130,16 +133,14 @@ select = [
"C", # flake8-comprehensions
"B", # flake8-bugbear
"UP", # Python upgrade, automatically upgrade syntax for newer versions of the language.
"S", # flake8-bandit
"S", # flake8-bandit
]

target-version = "py38"

# Avoid trying to fix flake8-bugbear (`B`) violations.
unfixable = ["B"]

ignore = [
"E501", # line too long, handled by black
"E501", # line too long, handled by formatter
"B008", # do not perform function calls in argument defaults
"C901", # too complex
"B012", # TODO: Consider mitigation: `return` inside `finally` blocks cause exceptions to be silenced
Expand All @@ -150,7 +151,7 @@ ignore = [
"S101", # Allow use of assert (especially for tests)
]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402", "F401"]


Expand Down

0 comments on commit a2a3e03

Please sign in to comment.