Skip to content

Commit

Permalink
update ruff config
Browse files Browse the repository at this point in the history
  • Loading branch information
gboeing committed Nov 24, 2023
1 parent fb4c86b commit 9524f12
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ visualization = ["matplotlib>=3.5"]

[project.urls]
Documentation = "https://osmnx.readthedocs.io"
Gallery = "https://github.com/gboeing/osmnx-examples"
Repository = "https://github.com/gboeing/osmnx"

[tool.black]
line_length = 100

[tool.hatch.build]
packages = ["osmnx"]

Expand All @@ -63,23 +61,26 @@ path = "osmnx/_version.py"
[tool.ruff]
cache-dir = "~/.cache/ruff"
exclude = ["build/*"]
ignore = ["PLR091"] # ignore complexity checks (we check mccabe elsewhere)
line-length = 110 # black line length + 10%
select = [
line-length = 100
target-version = "py38"

[tool.ruff.lint]
extend-ignore = ["PLR091"] # ignore PLR complexity checks (we check mccabe with C9)
extend-select = [
"A", # check python builtins being used as variables or parameters
"ARG", # check unused function arguments
"B", # check common design problems a la flake8-bugbear
"BLE", # check for blind exception catching
"C4", # check proper comprehensions
"C9", # check mccabe complexity
"D", # check docstring conventions a la pydocstyle
"D417", # check missing arguments in docstrings (disabled by default for numpy convention)
"DTZ", # check unsafe naive datetime use a la flake8-datetimez
"E", # check code style conventions a la pycodestyle errors
"EM", # check raw literals inside exception raising
"ERA", # check commented-out code from python files a la eradicate
"F", # check python source code for errors a la pyflakes
"I", # check isort imports
"ISC", # check implicit string literal concatenation
"PERF", # check performance anti-patterns a la perflint
"PGH", # check pygrep hooks
"PIE", # check misc lints a la flake8-pie
Expand All @@ -92,21 +93,23 @@ select = [
"UP", # check outdated syntax a la pyupgrade
"W", # check code style conventions a la pycodestyle warnings
]
target-version = "py38"

[tool.ruff.isort]
[tool.ruff.lint.isort]
force-single-line = true

[tool.ruff.mccabe]
[tool.ruff.lint.mccabe]
max-complexity = 14

[tool.ruff.lint.pycodestyle]
max-line-length = 110 # line length + 10% since it isn't a hard upper bound

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ruff.per-file-ignores]
"./osmnx/_api.py" = ["F401"] # allow API imports to go unused
"./tests/test_osmnx.py" = [
"E402", # allow imports not at the top of the file
"F841", # allow unused local variables
"PLR2004", # allow magic values in comparisons
]

[tool.ruff.pydocstyle]
convention = "numpy"

0 comments on commit 9524f12

Please sign in to comment.