diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index e003ff90..57ccd03a 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -66,6 +66,9 @@ jobs: - name: Install Node dependencies run: | npm install -g markdownlint-cli jshint csslint + - name: Check with black + if: always() + run: python -m tox -e black && git diff --exit-code - name: Check with flake8 if: always() run: python -m tox -e flake8 diff --git a/requirements/project-min.txt b/requirements/project-min.txt index 00719753..7dc9825c 100644 --- a/requirements/project-min.txt +++ b/requirements/project-min.txt @@ -1,5 +1,5 @@ babel==2.9.0 -click==3.3 +click==8.0 Jinja2==2.10.2 markupsafe<=2.0.1 Markdown==3.3 diff --git a/requirements/project.txt b/requirements/project.txt index 2e1be0c8..bcf8e8d3 100644 --- a/requirements/project.txt +++ b/requirements/project.txt @@ -1,5 +1,5 @@ babel>=2.9.0 -click>=7.0 +click>=8.0 Jinja2>=2.10.2 Markdown>=3.3,<3.4 PyYAML>=5.2 diff --git a/requirements/test.txt b/requirements/test.txt index 9c4e8691..d38598f9 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -1,2 +1,3 @@ coverage +black flake8 diff --git a/setup.cfg b/setup.cfg index 1e6ff981..41194d3a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,10 @@ [metadata] license_file = LICENSE +[flake8] +max-line-length = 119 +extend-ignore = E203 + [compile_catalog] statistics = True domain = messages diff --git a/tox.ini b/tox.ini index e36af039..62799a82 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] envlist = py{36,37,38,39,310,py3}-{unittests,min-req,integration,integration-no-babel}, - flake8, markdown-lint, linkchecker, jshint, csslint, nobabel, codespell + black, flake8, markdown-lint, linkchecker, jshint, csslint, nobabel, codespell [testenv] passenv = LANG @@ -16,9 +16,13 @@ commands= py{36,37,38,39,310,py3}-unittests: {envbindir}/coverage report --show-missing py{36,37,38,39,310,py3}-integration: {envpython} -m mkdocs.tests.integration --output={envtmpdir}/builds +[testenv:black] +deps=-rrequirements/test.txt +commands={envbindir}/black -l100 -tpy36 --skip-string-normalization mkdocs + [testenv:flake8] deps=-rrequirements/test.txt -commands={envbindir}/flake8 mkdocs --max-line-length=119 +commands={envbindir}/flake8 mkdocs [testenv:markdown-lint] whitelist_externals=