Skip to content

Commit 2b4e946

Browse files
authored
Move black parameters to pyproject.toml (NVIDIA#6647)
Signed-off-by: Vladimir Bataev <[email protected]>
1 parent 232f9de commit 2b4e946

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

.pre-commit-config.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,4 @@ repos:
4343
hooks:
4444
- id: black
4545
name: Format code
46-
args: [--skip-string-normalization, --line-length=119]
4746
additional_dependencies: ['click==8.0.2']

pyproject.toml

+6
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ default_section = "THIRDPARTY"
2424
extend_skip = ["setup.py", "docs/source/conf.py"]
2525

2626

27+
[tool.black]
28+
line_length = 119
29+
skip_string_normalization = true
30+
required_version = "19.10b0" # recongized by future versions, disallows to reformat code with incompatible versions
31+
32+
2733
[tool.pytest.ini_options]
2834
# durations=0 will display all tests execution time, sorted in ascending order starting from from the slowest one.
2935
# -vv will also display tests with durration = 0.00s

setup.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,8 @@ def req_file(filename, folder="requirements"):
111111

112112

113113
class StyleCommand(distutils_cmd.Command):
114-
__LINE_WIDTH = 119
115-
__ISORT_BASE = 'isort '
116-
__BLACK_BASE = f'black --skip-string-normalization --line-length={__LINE_WIDTH}'
114+
__ISORT_BASE = 'isort'
115+
__BLACK_BASE = 'black'
117116
description = 'Checks overall project code style.'
118117
user_options = [
119118
('scope=', None, 'Folder of file to operate within.'),

0 commit comments

Comments
 (0)