Skip to content

Commit f558bbb

Browse files
committed
Add ruff setup
1 parent 16f6801 commit f558bbb

File tree

2 files changed

+63
-24
lines changed

2 files changed

+63
-24
lines changed

Diff for: .pre-commit-config.yaml

+5-17
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,9 @@ repos:
66
- id: check-yaml
77
- id: end-of-file-fixer
88
- id: trailing-whitespace
9-
- repo: 'https://github.com/asottile/pyupgrade'
10-
rev: v3.15.0
9+
- repo: https://github.com/astral-sh/ruff-pre-commit
10+
rev: v0.4.8
1111
hooks:
12-
- id: pyupgrade
13-
args:
14-
- '--py38-plus'
15-
- repo: 'https://github.com/PyCQA/isort'
16-
rev: 5.12.0
17-
hooks:
18-
- id: isort
19-
- repo: 'https://github.com/psf/black'
20-
rev: 23.11.0
21-
hooks:
22-
- id: black
23-
- repo: 'https://github.com/pycqa/flake8'
24-
rev: 6.1.0
25-
hooks:
26-
- id: flake8
12+
- id: ruff
13+
args: [ --fix ]
14+
- id: ruff-format

Diff for: pyproject.toml

+58-7
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,63 @@ markers = [
33
"slow: marks tests as slow",
44
]
55

6-
[tool.isort]
7-
profile = "black"
8-
line_length = 79
9-
honor_noqa = true
10-
src_paths = ["boto3", "tests"]
6+
[tool.ruff]
7+
exclude = [
8+
".bzr",
9+
".direnv",
10+
".eggs",
11+
".git",
12+
".git-rewrite",
13+
".hg",
14+
".ipynb_checkpoints",
15+
".mypy_cache",
16+
".nox",
17+
".pants.d",
18+
".pyenv",
19+
".pytest_cache",
20+
".pytype",
21+
".ruff_cache",
22+
".svn",
23+
".tox",
24+
".venv",
25+
".vscode",
26+
"__pypackages__",
27+
"_build",
28+
"buck-out",
29+
"build",
30+
"dist",
31+
"node_modules",
32+
"site-packages",
33+
"venv",
34+
]
1135

12-
[tool.black]
36+
# Format same as Black.
1337
line-length = 79
14-
skip_string_normalization = true
38+
indent-width = 4
39+
40+
target-version = "py38"
41+
42+
[tool.ruff.lint]
43+
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
44+
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
45+
# McCabe complexity (`C901`) by default.
46+
select = ["E4", "E7", "E9", "F", "I", "UP"]
47+
ignore = []
48+
49+
# Allow fix for all enabled rules (when `--fix`) is provided.
50+
fixable = ["ALL"]
51+
unfixable = []
52+
53+
# Allow unused variables when underscore-prefixed.
54+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
55+
56+
[tool.ruff.format]
57+
# Like Black, use double quotes for strings, spaces for indents
58+
# and trailing commas.
59+
quote-style = "preserve"
60+
indent-style = "space"
61+
skip-magic-trailing-comma = false
62+
line-ending = "auto"
63+
64+
docstring-code-format = false
65+
docstring-code-line-length = "dynamic"

0 commit comments

Comments
 (0)