Skip to content

Commit 5752f8c

Browse files
committed
Remove flake8 and black references
List all ignored rules in ruff to make it easier to fix them later.
1 parent 889ee39 commit 5752f8c

File tree

8 files changed

+39
-42
lines changed

8 files changed

+39
-42
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
"extensions": [
1010
"ms-python.python",
1111
"ms-python.debugpy",
12-
"ms-python.black-formatter"
12+
"charliermarsh.ruff"
1313
],
1414
"settings": {
1515
"extensions.verifySignature": false
1616
}
1717
}
1818
}
19-
}
19+
}

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: |
2828
python -m pip install --upgrade pip
2929
pip install ".[dev]"
30-
- name: 🧹 Lint with flake8
30+
- name: 🧹 Lint
3131
run: |
3232
make check_code_quality
3333
- name: Check types with mypy

.pre-commit-config.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,6 @@ repos:
2323
args: ["--autofix", "--no-sort-keys", "--indent=4"]
2424
- id: trailing-whitespace
2525

26-
- repo: https://github.com/PyCQA/flake8
27-
rev: 7.1.0
28-
hooks:
29-
- id: flake8
30-
name: Flake8 Checks
31-
entry: flake8
32-
additional_dependencies: [Flake8-pyproject]
33-
3426
- repo: https://github.com/PyCQA/bandit
3527
rev: 1.7.9
3628
hooks:

.vscode/settings.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@
1212
],
1313
"editor.formatOnSave": true,
1414
"[python]": {
15-
"editor.defaultFormatter": "ms-python.black-formatter"
15+
"editor.defaultFormatter": "charliermarsh.ruff"
1616
},
17-
"python.formatting.provider": "none",
1817
"python.testing.pytestEnabled": false,
1918
"editor.inlineSuggest.showToolbar": "onHover"
20-
}
19+
}

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pip install -e ".[dev]"
2828

2929
### Devcontainer
3030

31-
This project comes with a [convenient devcontainer](https://www.loom.com/share/a183c4a351ed4700a79476fedf08ab9b) that makes it easier to run tests and has black configured to run on save.
31+
This project comes with a [convenient devcontainer](https://www.loom.com/share/a183c4a351ed4700a79476fedf08ab9b) that makes it easier to run tests and has lint configured to run on save.
3232

3333
On rare occasions a full rebuild is needed, you can do it in VSCode by pressing `Ctrl+Shift+P` and running `Dev Containers: Rebuild Container`.
3434

@@ -57,10 +57,10 @@ def example_function(param1: int, param2: str) -> bool:
5757
We provide a `Makefile` to format and ensure code quality. **Be sure to run them before creating a PR**.
5858

5959
```bash
60-
# format code with `black` and `isort`
60+
# format code with `ruff`
6161
make style
6262

63-
# check code with flake8
63+
# check code with `ruff`
6464
make check_code_quality
6565
```
6666

Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ style:
1010
check_code_quality:
1111
ruff format $(check_dirs) --check
1212
ruff check $(check_dirs)
13-
# stop the build if there are Python syntax errors or undefined names
14-
flake8 $(check_dirs) --count --select=E9,F63,F7,F82 --show-source --statistics
15-
# exit-zero treats all errors as warnings. E203 for black, E501 for docstring, W503 for line breaks before logical operators
16-
flake8 $(check_dirs) --count --max-line-length=120 --exit-zero --ignore=D --extend-ignore=E203,E501,W503 --statistics
1713

1814
publish:
1915
python setup.py sdist bdist_wheel

pyproject.toml

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,49 @@
22
requires = ["setuptools>=57", "wheel"]
33
build-backend = "setuptools.build_meta"
44

5-
[tool.flake8]
6-
exclude = ".venv"
7-
max-complexity = 10
8-
max-line-length = 120
9-
extend-ignore = """
10-
W503,
11-
E203,
12-
E701,
13-
C901,
14-
"""
15-
per-file-ignores = """
16-
__init__.py: F401
17-
"""
18-
195
[tool.bandit]
206
target = ["test", "roboflow"]
217
tests = ["B201", "B301"]
228

239
[tool.ruff]
2410
target-version = "py38"
25-
# Same as Black.
2611
line-length = 120
2712

2813
[tool.ruff.lint]
2914
select = [
30-
"E", # pycodestyle errors
31-
"F", # pyflakes
32-
"I", # isort
33-
"UP", # pyupgrade
15+
"ALL",
3416
]
3517
ignore = [
36-
"E501", # line too long, handled by black
18+
"A",
19+
"ANN",
20+
"ARG",
21+
"B",
22+
"BLE",
23+
"C",
24+
"COM",
25+
"D",
26+
"DTZ",
27+
"EM",
28+
"ERA",
29+
"FBT",
30+
"FIX",
31+
"FLY",
32+
"ISC",
33+
"N",
34+
"PERF",
35+
"PIE",
36+
"PLR",
37+
"PLW",
38+
"PT",
39+
"PTH",
40+
"RET",
41+
"RUF",
42+
"S",
43+
"SIM",
44+
"SLF",
45+
"T",
46+
"TD",
47+
"TRY",
3748
]
3849

3950
# Exclude a variety of commonly ignored directories.

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
extras_require={
3232
"desktop": ["opencv-python==4.8.0.74"],
3333
"dev": [
34-
"flake8",
3534
"mypy",
3635
"responses",
3736
"ruff",

0 commit comments

Comments
 (0)