Skip to content

Commit

Permalink
chore: prepare for ruff-format (#2773)
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii authored Oct 26, 2023
1 parent 04974c5 commit e8072ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
8 changes: 1 addition & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ repos:
- id: name-tests-test
args: ["--pytest-test-first"]

- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.5.0
hooks:
- id: setup-cfg-fmt
args: [--include-version-classifiers, --max-py-version=3.11]

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.10.0
hooks:
Expand All @@ -39,7 +33,7 @@ repos:
additional_dependencies: [pyyaml]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.1
rev: v0.1.2
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down
14 changes: 6 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -257,13 +257,16 @@ ignore_errors = true
ignore_missing_imports = true

[tool.ruff]
typing-modules = ["awkward._typing"]
src = ["src"]
extend-exclude = [
"studies",
"pybind11",
"rapidjson",
"docs-*",
"src/awkward/_typeparser/generated_parser.py",
]
[tool.ruff.lint]
select = [
"E", "F", "W", # flake8
"B", "B904", # flake8-bugbear
Expand All @@ -282,7 +285,7 @@ select = [
"NPY", # NumPy specific rules
"TID251", # flake8-tidy-imports
]
extend-ignore = [
ignore = [
"E501", # Line too long
"UP030", # {0} -> {}
"PLR", # Design related pylint codes
Expand All @@ -292,16 +295,14 @@ extend-ignore = [
"PLW0603", # Using the global statement to update is discouraged
"PLC1901", # x == "" can be simplified to not x (empty string is falsey)
]
typing-modules = ["awkward._typing"]
src = ["src"]
unfixable = [
"T20", # Removes print statements
"F841", # Removes unused variables
]
external = []
mccabe.max-complexity = 100

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"dev/*" = ["T20", "TID251"]
"src/awkward/numba/*" = ["TID251"]
"src/awkward/_errors.py" = ["TID251"]
Expand All @@ -315,10 +316,7 @@ mccabe.max-complexity = 100
"src/awkward/_operators.py" = ["TID251"]
"tests*/*" = ["T20", "TID251"]

[tool.ruff.flake8-tidy-imports.banned-api]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"numpy".msg = "Use `numpy = ak._nplikes.Numpy.instance()` instead"
"jax".msg = "Use `jax = ak._nplikes.Jax.instance()` instead"
"cupy".msg = "Use `cupy = ak._nplikes.Cupy.instance()` instead"

[tool.nbqa.addopts]
pyupgrade = ["--py38-plus"]

0 comments on commit e8072ce

Please sign in to comment.