Skip to content

Commit

Permalink
Swap some to Ruff
Browse files Browse the repository at this point in the history
* pycodestyle is deprecated in favor of Ruff, so swap in Ruff where possible
* Clean up stale components of the linting configuration
  • Loading branch information
sco1 committed Mar 17, 2024
1 parent 26b6ba5 commit 483cdd3
Show file tree
Hide file tree
Showing 5 changed files with 214 additions and 233 deletions.
27 changes: 6 additions & 21 deletions .flake8
@@ -1,30 +1,15 @@
[flake8]
max-line-length=100
docstring-convention=all
extend-ignore=
P102,B311,W503,E226,S311,
# Missing Docstrings
D100,D104,D105,D107,
# Docstring Whitespace
D203,D212,D214,D215,
# Docstring Quotes
D301,D302,
# Docstring Content
D400,D401,D402,D404,D405,D406,D407,D408,D409,D410,D411,D412,D413,D414,D416,D417,
# Type Annotations
# pycodestyle
E226,
# flake8-annotations
ANN002,ANN003,ANN101,ANN102,ANN204,ANN206,
# pep8-naming
N802,N806,N815,
extend-select=
# Type Guards
TC1
exclude=
__pycache__,.cache,
venv,.venv,
extend-exclude=
venv, .venv,
build, dist,
error_codes.py,
.tox
per-file-ignores =
testing/test_*.py:TC E501 D103,
testing/test_*.py:E501,
import-order-style=pycharm
application-import-names=flake8_annotations,testing
8 changes: 6 additions & 2 deletions .pre-commit-config.yaml
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/psf/black
rev: 24.1.1
rev: 24.3.0
hooks:
- id: black
- repo: https://github.com/pycqa/isort
Expand All @@ -25,10 +25,14 @@ repos:
hooks:
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.3
hooks:
- id: ruff
- repo: local
hooks:
- id: flake8
name: Flake8
name: flake8-local
description: This hook runs flake8 within our project's poetry environment.
entry: poetry run flake8
language: python
Expand Down
55 changes: 55 additions & 0 deletions .ruff.toml
@@ -0,0 +1,55 @@
line-length = 100
fix = false
output-format = "grouped"

extend-exclude = [
"__pycache__",
".cache",
"error_codes.py",
]

[lint]
select = [
"B", # flake8-bugbear
"FIX", # flake8-fixme
"D", # pydocstyle/flake8-docstrings
"N", # pep8-naming
]

ignore = [
# pydocstyle
"D100",
"D104",
"D105",
"D107",
"D203",
"D212",
"D214",
"D215",
"D301",
"D400",
"D401",
"D402",
"D404",
"D405",
"D406",
"D407",
"D408",
"D409",
"D410",
"D411",
"D412",
"D413",
"D414",
"D416",
"D417",
# pep8-naming
"N802",
"N806",
"N815",
]

[lint.per-file-ignores]
"testing/test_*.py" = [
"D103",
]

0 comments on commit 483cdd3

Please sign in to comment.