Skip to content

Commit c686e68

Browse files
committed
[py]: Recipe for black; configure flake8 to work in tandem
1 parent 3167e93 commit c686e68

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

py/setup.cfg

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
[flake8]
22
exclude = .tox,docs/source/conf.py,*venv
3-
ignore = E501
3+
# Disable this once black is applied throughout & line length is better handled.
4+
extend-ignore = E501, E203
5+
# This does nothing for now as E501 is ignored.
6+
max-line-length = 120
47

58
[tool:pytest]
6-
addopts = -r=a
9+
addopts = -ra
710
python_files = test_*.py *_tests.py
811
testpaths = test

py/tox.ini

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ commands = mypy {posargs}
3030
; PEP recommended sections (https://peps.python.org/pep-0008/#imports)
3131
; files or individual lines can be ignored via `# isort:skip|# isort:skip_file`.
3232
; this is using --diff which is a NO-OP, requires additional discussion / approval being enabled.
33+
; Right now it is opt in and not enforced in CI but will be in future.
3334
profile = black
3435
py_version=37
3536
force_single_line = True
@@ -39,3 +40,13 @@ skip_install = true
3940
deps =
4041
isort==5.10.1
4142
commands = isort selenium/ test/
43+
44+
[testenv:black]
45+
; black is a common python code formatter. This allows us to keep code completely
46+
; consistent throughout all contributions and reduce merge conflicts in future.
47+
; Right now it is opt in and not enforced in CI but will be in future.
48+
skip_install = true
49+
deps =
50+
black==22.8.0
51+
commands =
52+
black test/ -l 120

0 commit comments

Comments
 (0)