Skip to content

Commit fe7cfe5

Browse files
authored
Adopt black as code formatting tool. (#85)
* Adopt black as code formatting tool. * Format zigpy_deconz with black. * Format tests with black. * Format setup.py with black.
1 parent 1ae629a commit fe7cfe5

File tree

14 files changed

+536
-364
lines changed

14 files changed

+536
-364
lines changed

.pre-commit-config.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 19.3b0
4+
hooks:
5+
- id: black
6+
args:
7+
- --safe
8+
- --quiet
9+
- repo: https://gitlab.com/pycqa/flake8
10+
rev: 3.7.8
11+
hooks:
12+
- id: flake8

setup.cfg

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[flake8]
2+
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build
3+
# To work with Black
4+
max-line-length = 88
5+
# W503: Line break occurred before a binary operator
6+
# E203: Whitespace before ':'
7+
# D202 No blank lines allowed after function docstring
8+
ignore =
9+
W503,
10+
E203,
11+
D202
12+
13+
[isort]
14+
# https://github.com/timothycrosley/isort
15+
# https://github.com/timothycrosley/isort/wiki/isort-Settings
16+
# splits long import on multiple lines indented by 4 spaces
17+
multi_line_output = 3
18+
include_trailing_comma=True
19+
force_grid_wrap=0
20+
use_parentheses=True
21+
line_length=88
22+
indent = " "
23+
# by default isort don't check module indexes
24+
not_skip = __init__.py
25+
# will group `import x` and `from x import` of the same module.
26+
force_sort_within_sections = true
27+
sections = FUTURE,STDLIB,INBETWEENS,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
28+
default_section = THIRDPARTY
29+
known_first_party = zigpy_deconz,tests
30+
forced_separate = tests
31+
combine_as_imports = true

setup.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,7 @@
1212
author="Daniel Schmidt",
1313
author_email="[email protected]",
1414
license="GPL-3.0",
15-
packages=find_packages(exclude=['*.tests']),
16-
install_requires=[
17-
'pyserial-asyncio',
18-
'zigpy-homeassistant>=0.10.0',
19-
],
20-
tests_require=[
21-
'pytest',
22-
],
15+
packages=find_packages(exclude=["*.tests"]),
16+
install_requires=["pyserial-asyncio", "zigpy-homeassistant>=0.10.0"],
17+
tests_require=["pytest"],
2318
)

0 commit comments

Comments
 (0)