Skip to content

Commit da58717

Browse files
[ci] toml formatter (#3802)
### Changes Add formatter for toml files
1 parent 1451632 commit da58717

File tree

2 files changed

+61
-56
lines changed

2 files changed

+61
-56
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,10 @@ repos:
3333
rev: v1.7.9
3434
hooks:
3535
- id: actionlint
36+
37+
- repo: https://github.com/ComPWA/taplo-pre-commit
38+
rev: v0.9.3
39+
hooks:
40+
- id: taplo-format
41+
files: \.toml$
42+
args: ["--option", "indent_string= "]

pyproject.toml

Lines changed: 54 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -96,70 +96,68 @@ disable_error_code = ["empty-body", "no-any-return"]
9696

9797
[tool.ruff]
9898
line-length = 120
99-
exclude = [
100-
"src/nncf/torch/function_hook/handle_inner_functions.py"
101-
]
99+
exclude = ["src/nncf/torch/function_hook/handle_inner_functions.py"]
102100

103101
[tool.ruff.lint]
104102
preview = true
105103
ignore = [
106-
"E201", # whitespace-after-open-bracket
107-
"E203", # whitespace-before-punctuation
108-
"E231", # missing-whitespace
109-
"E251", # unexpected-spaces-around-keyword-parameter-equals
110-
"E731", # lambda-assignment
111-
"SIM108", # if-else-block-instead-of-if-exp
112-
"SIM110", # reimplemented-builtin
113-
"SIM117", # multiple-with-statements
114-
"SIM103", # needless-bool
115-
"NPY002", # numpy-legacy-random
116-
"UP007", # non-pep604-annotation-union
117-
"UP035", # deprecated-import
118-
"UP038", # non-pep604-isinstance
119-
"UP045", # non-pep604-annotation-optional
120-
"D100", # undocumented-public-module
121-
"D101", # undocumented-public-class
122-
"D102", # undocumented-public-method
123-
"D103", # undocumented-public-function
124-
"D104", # undocumented-public-package
125-
"D105", # undocumented-magic-method
126-
"D106", # undocumented-public-nested-class
127-
"D107", # undocumented-public-init
128-
"D200", # unnecessary-multiline-docstring
129-
"D203", # incorrect-blank-line-before-class
130-
"D205", # missing-blank-line-after-summary
131-
"D212", # multi-line-summary-first-line
132-
"D400", # missing-trailing-period
133-
"D401", # non-imperative-mood
134-
"D402", # signature-in-docstring
135-
"D404", # docstring-starts-with-this
136-
"D413", # missing-blank-line-after-last-section
137-
"D415", # missing-terminal-punctuation
138-
"D417", # undocumented-param
104+
"E201", # whitespace-after-open-bracket
105+
"E203", # whitespace-before-punctuation
106+
"E231", # missing-whitespace
107+
"E251", # unexpected-spaces-around-keyword-parameter-equals
108+
"E731", # lambda-assignment
109+
"SIM108", # if-else-block-instead-of-if-exp
110+
"SIM110", # reimplemented-builtin
111+
"SIM117", # multiple-with-statements
112+
"SIM103", # needless-bool
113+
"NPY002", # numpy-legacy-random
114+
"UP007", # non-pep604-annotation-union
115+
"UP035", # deprecated-import
116+
"UP038", # non-pep604-isinstance
117+
"UP045", # non-pep604-annotation-optional
118+
"D100", # undocumented-public-module
119+
"D101", # undocumented-public-class
120+
"D102", # undocumented-public-method
121+
"D103", # undocumented-public-function
122+
"D104", # undocumented-public-package
123+
"D105", # undocumented-magic-method
124+
"D106", # undocumented-public-nested-class
125+
"D107", # undocumented-public-init
126+
"D200", # unnecessary-multiline-docstring
127+
"D203", # incorrect-blank-line-before-class
128+
"D205", # missing-blank-line-after-summary
129+
"D212", # multi-line-summary-first-line
130+
"D400", # missing-trailing-period
131+
"D401", # non-imperative-mood
132+
"D402", # signature-in-docstring
133+
"D404", # docstring-starts-with-this
134+
"D413", # missing-blank-line-after-last-section
135+
"D415", # missing-terminal-punctuation
136+
"D417", # undocumented-param
139137
"PERF203", # try-except-in-loop
140138
"PERF401", # manual-list-comprehension
141139
"PERF403", # manual-dict-comprehension
142-
"B009", # get-attr-with-constant
143-
"B010", # set-attr-with-constant
144-
"B905", # zip-without-explicit-strict
145-
"RET502", # implicit-return-value
146-
"RET503", # implicit-return
147-
"RET504", # unnecessary-assign
140+
"B009", # get-attr-with-constant
141+
"B010", # set-attr-with-constant
142+
"B905", # zip-without-explicit-strict
143+
"RET502", # implicit-return-value
144+
"RET503", # implicit-return
145+
"RET504", # unnecessary-assign
148146
]
149147
select = [
150148
"CPY001", # copyright check
151-
"D", # pydocstyle
152-
"E", # pycodestyle rules
153-
"EM", # flake8-errmsg
154-
"F", # pyflakes rules
155-
"I", # isort
156-
"INP", # flake8-no-pep420
157-
"ISC", # flake8-implicit-str-concat
158-
"NPY", # numpy rules
159-
"UP", # pyupgrade
160-
"PERF", # perflint
161-
"B", # flake8-bugbear
162-
"RET", # flake8-return
149+
"D", # pydocstyle
150+
"E", # pycodestyle rules
151+
"EM", # flake8-errmsg
152+
"F", # pyflakes rules
153+
"I", # isort
154+
"INP", # flake8-no-pep420
155+
"ISC", # flake8-implicit-str-concat
156+
"NPY", # numpy rules
157+
"UP", # pyupgrade
158+
"PERF", # perflint
159+
"B", # flake8-bugbear
160+
"RET", # flake8-return
163161
]
164162
extend-select = [
165163
"SIM", # https://pypi.org/project/flake8-simplify
@@ -197,6 +195,6 @@ pythonpath = "."
197195
[tool.bandit]
198196
exclude_dirs = ["tools", "tests", "**/venv*", "build"]
199197
skips = [
200-
"B101", # assert_used
201-
"B404" , # import_subprocess
198+
"B101", # assert_used
199+
"B404", # import_subprocess
202200
]

0 commit comments

Comments
 (0)