Skip to content

Commit 5b70abb

Browse files
committed
Replace flake8 and isort with ruff
1 parent 17c8122 commit 5b70abb

File tree

6 files changed

+52
-72
lines changed

6 files changed

+52
-72
lines changed

.pre-commit-config.yaml

+4-17
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
## Pre-commit setup
22
# See https://github.com/python-discord/code-jam-template/tree/main#pre-commit-run-linting-before-committing
33

4-
# Make sure to edit the `additional_dependencies` list if you want to add plugins
5-
64
repos:
75
- repo: https://github.com/pre-commit/pre-commit-hooks
86
rev: v4.5.0
@@ -13,19 +11,8 @@ repos:
1311
- id: trailing-whitespace
1412
args: [--markdown-linebreak-ext=md]
1513

16-
- repo: https://github.com/pre-commit/pygrep-hooks
17-
rev: v1.5.1
18-
hooks:
19-
- id: python-check-blanket-noqa
20-
21-
- repo: https://github.com/PyCQA/isort
22-
rev: 5.12.0
23-
hooks:
24-
- id: isort
25-
26-
- repo: https://github.com/pycqa/flake8
27-
rev: 4.0.1
14+
- repo: https://github.com/astral-sh/ruff-pre-commit
15+
rev: v0.3.5
2816
hooks:
29-
- id: flake8
30-
additional_dependencies:
31-
- flake8-docstrings~=1.6.0
17+
- id: ruff
18+
- id: ruff-format

pyproject.toml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[tool.ruff]
2+
# Increase the line length. This breaks PEP8 but it is way easier to work with.
3+
# The original reason for this limit was a standard vim terminal is only 79 characters,
4+
# but this doesn't really apply anymore.
5+
line-length = 119
6+
# Target Python 3.12. If you decide to use a different version of Python
7+
# you will need to update this value.
8+
target-version = "py312"
9+
# Automatically fix auto-fixable issues.
10+
fix = true
11+
# The directory containing the source code. If you choose a different project layout
12+
# you will need to update this value.
13+
src = ["src"]
14+
15+
[tool.ruff.lint]
16+
# Enable all linting rules.
17+
select = ["ALL"]
18+
# Ignore some of the most obnoxious linting errors.
19+
ignore = [
20+
# Missing docstrings.
21+
"D100",
22+
"D104",
23+
"D105",
24+
"D106",
25+
"D107",
26+
# Docstring whitespace.
27+
"D203",
28+
"D213",
29+
# Docstring quotes.
30+
"D301",
31+
# Builtins.
32+
"A",
33+
# Print statements.
34+
"T20",
35+
# TODOs.
36+
"TD002",
37+
"TD003",
38+
"FIX",
39+
# Annotations.
40+
"ANN101",
41+
"ANN102",
42+
]

dev-requirements.txt renamed to requirements-dev.txt

+2-7
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,5 @@
22
# Don't forget to pin your dependencies!
33
# This list will have to be migrated if you wish to use another dependency manager.
44

5-
# Base tools
6-
flake8~=4.0.1
7-
isort~=5.10.1
8-
pre-commit~=2.17.0
9-
10-
# Flake8 plugins, see https://github.com/python-discord/code-jam-template/tree/main#plugin-list
11-
flake8-docstrings~=1.6.0
5+
ruff~=0.3.5
6+
pre-commit~=3.7.0

samples/Pipfile

+2-7
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@ name = "pypi"
66
[packages]
77

88
[dev-packages]
9-
# Base tools
10-
flake8 = "~=4.0.1"
11-
isort = "~=5.12.0"
12-
pre-commit = "~=2.17.0"
13-
14-
# Flake8 plugins, see https://github.com/python-discord/code-jam-template/tree/main#plugin-list
15-
flake8-docstrings = "~=1.6.0"
9+
ruff = "~=0.3.5"
10+
pre-commit = "~=3.7.0"
1611

1712
[requires]
1813
python_version = "3.10"

samples/pyproject.toml

+2-8
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,8 @@ license = "MIT"
99
python = "3.10.*"
1010

1111
[tool.poetry.dev-dependencies]
12-
# Base tools
13-
flake8 = "~4.0.1"
14-
isort = "~5.12.0"
15-
pre-commit = "~2.17.0"
16-
17-
# Flake8 plugins, see https://github.com/python-discord/code-jam-template/tree/main#plugin-list
18-
flake8-docstrings = "~1.6.0"
19-
12+
ruff = "~0.3.5"
13+
pre-commit = "~3.7.0"
2014

2115
[build-system]
2216
requires = ["poetry-core>=1.0.0"]

tox.ini

-33
This file was deleted.

0 commit comments

Comments
 (0)