Skip to content

Commit

Permalink
[py]: Recipe for black; configure flake8 to work in tandem
Browse files Browse the repository at this point in the history
  • Loading branch information
symonk committed Oct 1, 2022
1 parent 3167e93 commit c686e68
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
7 changes: 5 additions & 2 deletions py/setup.cfg
@@ -1,8 +1,11 @@
[flake8]
exclude = .tox,docs/source/conf.py,*venv
ignore = E501
# Disable this once black is applied throughout & line length is better handled.
extend-ignore = E501, E203
# This does nothing for now as E501 is ignored.
max-line-length = 120

[tool:pytest]
addopts = -r=a
addopts = -ra
python_files = test_*.py *_tests.py
testpaths = test
11 changes: 11 additions & 0 deletions py/tox.ini
Expand Up @@ -30,6 +30,7 @@ commands = mypy {posargs}
; PEP recommended sections (https://peps.python.org/pep-0008/#imports)
; files or individual lines can be ignored via `# isort:skip|# isort:skip_file`.
; this is using --diff which is a NO-OP, requires additional discussion / approval being enabled.
; Right now it is opt in and not enforced in CI but will be in future.
profile = black
py_version=37
force_single_line = True
Expand All @@ -39,3 +40,13 @@ skip_install = true
deps =
isort==5.10.1
commands = isort selenium/ test/

[testenv:black]
; black is a common python code formatter. This allows us to keep code completely
; consistent throughout all contributions and reduce merge conflicts in future.
; Right now it is opt in and not enforced in CI but will be in future.
skip_install = true
deps =
black==22.8.0
commands =
black test/ -l 120

0 comments on commit c686e68

Please sign in to comment.