Skip to content

Commit

Permalink
Move black parameters to pyproject.toml (#6647)
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Bataev <[email protected]>
  • Loading branch information
artbataev authored May 12, 2023
1 parent 232f9de commit 2b4e946
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,4 @@ repos:
hooks:
- id: black
name: Format code
args: [--skip-string-normalization, --line-length=119]
additional_dependencies: ['click==8.0.2']
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ default_section = "THIRDPARTY"
extend_skip = ["setup.py", "docs/source/conf.py"]


[tool.black]
line_length = 119
skip_string_normalization = true
required_version = "19.10b0" # recongized by future versions, disallows to reformat code with incompatible versions


[tool.pytest.ini_options]
# durations=0 will display all tests execution time, sorted in ascending order starting from from the slowest one.
# -vv will also display tests with durration = 0.00s
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,8 @@ def req_file(filename, folder="requirements"):


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

0 comments on commit 2b4e946

Please sign in to comment.