Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: prepare for ruff-format #2773

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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]

agoose77 marked this conversation as resolved.
Show resolved Hide resolved
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.10.0
hooks:
agoose77 marked this conversation as resolved.
Show resolved Hide resolved
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"]