Skip to content

Commit 8d368f2

Browse files
committed
Add ruff config for awscli
1 parent 3a6ad35 commit 8d368f2

File tree

2 files changed

+93
-0
lines changed

2 files changed

+93
-0
lines changed

.pre-commit-config.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
exclude: "\
2+
^(\
3+
.github|\
4+
.changes|\
5+
docs/|\
6+
awscli/examples|\
7+
CHANGELOG.rst\
8+
)"
9+
repos:
10+
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
11+
rev: v4.5.0
12+
hooks:
13+
- id: check-yaml
14+
- id: end-of-file-fixer
15+
- id: trailing-whitespace
16+
- repo: 'https://github.com/PyCQA/isort'
17+
rev: 5.12.0
18+
hooks:
19+
- id: isort
20+
- repo: https://github.com/astral-sh/ruff-pre-commit
21+
rev: v0.4.8
22+
hooks:
23+
- id: ruff
24+
args: [ --fix ]
25+
- id: ruff-format
26+

pyproject.toml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,70 @@ markers = [
33
"slow: marks tests as slow",
44
"validates_models: marks tests as one which validates service models",
55
]
6+
7+
[tool.isort]
8+
profile = "black"
9+
line_length = 79
10+
honor_noqa = true
11+
src_paths = ["awscli", "tests"]
12+
13+
[tool.ruff]
14+
exclude = [
15+
".bzr",
16+
".direnv",
17+
".eggs",
18+
".git",
19+
".git-rewrite",
20+
".hg",
21+
".ipynb_checkpoints",
22+
".mypy_cache",
23+
".nox",
24+
".pants.d",
25+
".pyenv",
26+
".pytest_cache",
27+
".pytype",
28+
".ruff_cache",
29+
".svn",
30+
".tox",
31+
".venv",
32+
".vscode",
33+
"__pypackages__",
34+
"_build",
35+
"buck-out",
36+
"build",
37+
"dist",
38+
"node_modules",
39+
"site-packages",
40+
"venv",
41+
]
42+
43+
# Format same as Black.
44+
line-length = 79
45+
indent-width = 4
46+
47+
target-version = "py38"
48+
49+
[tool.ruff.lint]
50+
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
51+
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
52+
# McCabe complexity (`C901`) by default.
53+
select = ["E4", "E7", "E9", "F", "UP"]
54+
ignore = []
55+
56+
# Allow fix for all enabled rules (when `--fix`) is provided.
57+
fixable = ["ALL"]
58+
unfixable = []
59+
60+
# Allow unused variables when underscore-prefixed.
61+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
62+
63+
[tool.ruff.format]
64+
# Like Black, use double quotes for strings, spaces for indents
65+
# and trailing commas.
66+
quote-style = "preserve"
67+
indent-style = "space"
68+
skip-magic-trailing-comma = false
69+
line-ending = "auto"
70+
71+
docstring-code-format = false
72+
docstring-code-line-length = "dynamic"

0 commit comments

Comments
 (0)