Skip to content

Commit 408c24a

Browse files
[pre-commit.ci] pre-commit autoupdate (#1709)
Signed-off-by: Sun, Xuehao <xuehao.sun@intel.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 71a9f39 commit 408c24a

File tree

2 files changed

+63
-78
lines changed

2 files changed

+63
-78
lines changed

.pre-commit-config.yaml

+6-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ exclude: |
1414
1515
repos:
1616
- repo: https://github.com/pre-commit/pre-commit-hooks
17-
rev: v4.5.0
17+
rev: v4.6.0
1818
hooks:
1919
- id: end-of-file-fixer
2020
files: (.*\.(py|md|rst|yaml|yml))$
@@ -55,7 +55,7 @@ repos:
5555
)$
5656
5757
- repo: https://github.com/Lucas-C/pre-commit-hooks
58-
rev: v1.5.4
58+
rev: v1.5.5
5959
hooks:
6060
- id: insert-license
6161
files: |
@@ -108,7 +108,7 @@ repos:
108108
)$
109109
110110
- repo: https://github.com/psf/black.git
111-
rev: 24.1.1
111+
rev: 24.3.0
112112
hooks:
113113
- id: black
114114
files: (.*\.py)$
@@ -125,7 +125,7 @@ repos:
125125
- id: blacken-docs
126126
args: [--line-length=120, --skip-errors]
127127
additional_dependencies:
128-
- black==24.1.1
128+
- black==24.3.0
129129
exclude: |
130130
(?x)^(
131131
examples/.+|
@@ -136,6 +136,7 @@ repos:
136136
rev: v2.2.6
137137
hooks:
138138
- id: codespell
139+
args: [-w]
139140
additional_dependencies:
140141
- tomli
141142
exclude: |
@@ -147,7 +148,7 @@ repos:
147148
)$
148149
149150
- repo: https://github.com/astral-sh/ruff-pre-commit
150-
rev: v0.1.15
151+
rev: v0.3.5
151152
hooks:
152153
- id: ruff
153154
args: [--fix, --exit-non-zero-on-fix, --no-cache]

pyproject.toml

+57-73
Original file line numberDiff line numberDiff line change
@@ -17,72 +17,6 @@ ignore-words = ".azure-pipelines/scripts/codeScan/codespell/inc_dict.txt"
1717

1818

1919
[tool.ruff]
20-
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
21-
select = ["E", "F"]
22-
ignore = [
23-
"E402", # Module level import not at top of file
24-
"E501", # Line too long (121 > 120 characters)
25-
"E721", # Do not compare types, use isinstance()
26-
"E722", # Do not use bare except
27-
"E731", # Do not assign a lambda expression, use a def
28-
"E741", # Do not use variables named ‘l’, ‘O’, or ‘I’
29-
"F401", # {name} imported but unused
30-
"F403", # from {name} import * used; unable to detect undefined names
31-
"F405", # {name} may be undefined, or defined from star imports
32-
"F841", # Local variable is assigned to but never used{name}
33-
]
34-
35-
ignore-init-module-imports = true
36-
37-
# Allow autofix for all enabled rules (when `--fix`) is provided.
38-
fixable = [
39-
"A",
40-
"B",
41-
"C",
42-
"D",
43-
"E",
44-
"F",
45-
"G",
46-
"I",
47-
"N",
48-
"Q",
49-
"S",
50-
"T",
51-
"W",
52-
"ANN",
53-
"ARG",
54-
"BLE",
55-
"COM",
56-
"DJ",
57-
"DTZ",
58-
"EM",
59-
"ERA",
60-
"EXE",
61-
"FBT",
62-
"ICN",
63-
"INP",
64-
"ISC",
65-
"NPY",
66-
"PD",
67-
"PGH",
68-
"PIE",
69-
"PL",
70-
"PT",
71-
"PTH",
72-
"PYI",
73-
"RET",
74-
"RSE",
75-
"RUF",
76-
"SIM",
77-
"SLF",
78-
"TCH",
79-
"TID",
80-
"TRY",
81-
"UP",
82-
"YTT",
83-
]
84-
unfixable = []
85-
8620
# Exclude a variety of commonly ignored directories.
8721
exclude = [
8822
".bzr",
@@ -91,35 +25,85 @@ exclude = [
9125
".git",
9226
".git-rewrite",
9327
".hg",
28+
".ipynb_checkpoints",
9429
".mypy_cache",
9530
".nox",
9631
".pants.d",
32+
".pyenv",
33+
".pytest_cache",
9734
".pytype",
9835
".ruff_cache",
9936
".svn",
10037
".tox",
10138
".venv",
39+
".vscode",
10240
"__pypackages__",
10341
"_build",
10442
"buck-out",
10543
"build",
10644
"dist",
10745
"node_modules",
46+
"site-packages",
10847
"venv",
10948
]
11049

11150
# Same as Black.
11251
line-length = 120
52+
indent-width = 4
53+
54+
# Assume Python 3.10
55+
target-version = "py310"
56+
57+
[tool.ruff.lint]
58+
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
59+
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
60+
# McCabe complexity (`C901`) by default.
61+
select = ["E4", "E7", "E9", "F"]
62+
ignore = [
63+
"E402", # Module level import not at top of file
64+
"E501", # Line too long (121 > 120 characters)
65+
"E721", # Do not compare types, use isinstance()
66+
"E722", # Do not use bare except
67+
"E731", # Do not assign a lambda expression, use a def
68+
"E741", # Do not use variables named ‘l’, ‘O’, or ‘I’
69+
"F401", # {name} imported but unused
70+
"F403", # from {name} import * used; unable to detect undefined names
71+
"F405", # {name} may be undefined, or defined from star imports
72+
"F841", # Local variable is assigned to but never used{name}
73+
]
74+
75+
# Allow fix for all enabled rules (when `--fix`) is provided.
76+
fixable = ["ALL"]
77+
unfixable = []
11378

11479
# Allow unused variables when underscore-prefixed.
11580
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
11681

117-
# Assume Python 3.10.
118-
target-version = "py310"
82+
ignore-init-module-imports = true
83+
84+
[tool.ruff.format]
85+
# Like Black, use double quotes for strings.
86+
quote-style = "double"
87+
88+
# Like Black, indent with spaces, rather than tabs.
89+
indent-style = "space"
90+
91+
# Like Black, respect magic trailing commas.
92+
skip-magic-trailing-comma = false
93+
94+
# Like Black, automatically detect the appropriate line ending.
95+
line-ending = "auto"
11996

120-
[tool.ruff.per-file-ignores]
121-
"**/__init__.py" = ["F401"]
97+
# Enable auto-formatting of code examples in docstrings. Markdown,
98+
# reStructuredText code/literal blocks and doctests are all supported.
99+
#
100+
# This is currently disabled by default, but it is planned for this
101+
# to be opt-out in the future.
102+
docstring-code-format = false
122103

123-
[tool.ruff.mccabe]
124-
# Unlike Flake8, default to a complexity level of 10.
125-
max-complexity = 10
104+
# Set the line length limit used when formatting code snippets in
105+
# docstrings.
106+
#
107+
# This only has an effect when the `docstring-code-format` setting is
108+
# enabled.
109+
docstring-code-line-length = "dynamic"

0 commit comments

Comments
 (0)