diff --git a/.flake8 b/.flake8 index 2bcd70e3..f1341238 100644 --- a/.flake8 +++ b/.flake8 @@ -1,2 +1,3 @@ [flake8] max-line-length = 88 +exclude = .svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg,node_modules,site diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5633e295..02f3812d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,3 @@ repos: rev: 1.19.1 hooks: - id: prettier - - repo: https://github.com/PyCQA/flake8 - rev: 3.7.9 - hooks: - - id: flake8 diff --git a/package.json b/package.json index bf76f163..12b20f92 100644 --- a/package.json +++ b/package.json @@ -33,12 +33,5 @@ "vscode-html-languageserver-bin": "^1.4.0", "webpack": "^4.41.5", "webpack-cli": "^3.3.10" - }, - "scripts": { - "build:slides": "webpack", - "lint:css": "stylelint --ignore-path .gitignore '**/*.css'", - "lint:js": "eslint --ext .js --ignore-path .gitignore .", - "lint:md": "remark --frail .", - "lint:pug": "pug-lint **/*.pug" } } diff --git a/poetry.lock b/poetry.lock index b62ff77c..c90d5a0b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -64,6 +64,28 @@ sqlparse = ">=0.2.2" argon2 = ["argon2-cffi (>=16.1.0)"] bcrypt = ["bcrypt"] +[[package]] +category = "dev" +description = "Discover and load entry points from installed packages." +name = "entrypoints" +optional = false +python-versions = ">=2.7" +version = "0.3" + +[[package]] +category = "dev" +description = "the modular source code checker: pep8, pyflakes and co" +name = "flake8" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "3.7.9" + +[package.dependencies] +entrypoints = ">=0.3.0,<0.4.0" +mccabe = ">=0.6.0,<0.7.0" +pycodestyle = ">=2.5.0,<2.6.0" +pyflakes = ">=2.1.0,<2.2.0" + [[package]] category = "main" description = "An HTML Minifier" @@ -147,6 +169,14 @@ optional = false python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" version = "1.1.1" +[[package]] +category = "dev" +description = "McCabe checker, plugin for flake8" +name = "mccabe" +optional = false +python-versions = "*" +version = "0.6.1" + [[package]] category = "main" description = "Project documentation with Markdown." @@ -233,6 +263,22 @@ six = "*" toml = "*" virtualenv = ">=15.2" +[[package]] +category = "dev" +description = "Python style guide checker" +name = "pycodestyle" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "2.5.0" + +[[package]] +category = "dev" +description = "passive checker of Python programs" +name = "pyflakes" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "2.1.1" + [[package]] category = "main" description = "Pygments is a syntax highlighting package written in Python." @@ -334,7 +380,7 @@ pathspec = ">=0.5.3" pyyaml = "*" [metadata] -content-hash = "15b467ecbeee65747c84dd0677afee562cad7ad1ee31e65e9d16f5883253c7cb" +content-hash = "38c09a528a04faa3f4aa1cc33d9c7fb270b5fac28fc9df071cb131fe54226e01" python-versions = "^3.8" [metadata.files] @@ -363,6 +409,14 @@ django = [ {file = "Django-3.0.2-py3-none-any.whl", hash = "sha256:4f2c913303be4f874015993420bf0bd8fd2097a9c88e6b49c6a92f9bdd3fb13a"}, {file = "Django-3.0.2.tar.gz", hash = "sha256:8c3575f81e11390893860d97e1e0154c47512f180ea55bd84ce8fa69ba8051ca"}, ] +entrypoints = [ + {file = "entrypoints-0.3-py2.py3-none-any.whl", hash = "sha256:589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19"}, + {file = "entrypoints-0.3.tar.gz", hash = "sha256:c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451"}, +] +flake8 = [ + {file = "flake8-3.7.9-py2.py3-none-any.whl", hash = "sha256:49356e766643ad15072a789a20915d3c91dc89fd313ccd71802303fd67e4deca"}, + {file = "flake8-3.7.9.tar.gz", hash = "sha256:45681a117ecc81e870cbf1262835ae4af5e7a8b08e40b944a8a6e6b895914cfb"}, +] htmlmin = [ {file = "htmlmin-0.1.12.tar.gz", hash = "sha256:50c1ef4630374a5d723900096a961cff426dff46b48f34d194a81bbe14eca178"}, ] @@ -420,6 +474,10 @@ markupsafe = [ {file = "MarkupSafe-1.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c"}, {file = "MarkupSafe-1.1.1.tar.gz", hash = "sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b"}, ] +mccabe = [ + {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, + {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, +] mkdocs = [ {file = "mkdocs-1.0.4-py2.py3-none-any.whl", hash = "sha256:8cc8b38325456b9e942c981a209eaeb1e9f3f77b493ad755bfef889b9c8d356a"}, {file = "mkdocs-1.0.4.tar.gz", hash = "sha256:17d34329aad75d5de604b9ed4e31df3a4d235afefdc46ce7b1964fddb2e1e939"}, @@ -447,6 +505,14 @@ pre-commit = [ {file = "pre_commit-1.21.0-py2.py3-none-any.whl", hash = "sha256:f92a359477f3252452ae2e8d3029de77aec59415c16ae4189bcfba40b757e029"}, {file = "pre_commit-1.21.0.tar.gz", hash = "sha256:8f48d8637bdae6fa70cc97db9c1dd5aa7c5c8bf71968932a380628c25978b850"}, ] +pycodestyle = [ + {file = "pycodestyle-2.5.0-py2.py3-none-any.whl", hash = "sha256:95a2219d12372f05704562a14ec30bc76b05a5b297b21a5dfe3f6fac3491ae56"}, + {file = "pycodestyle-2.5.0.tar.gz", hash = "sha256:e40a936c9a450ad81df37f549d676d127b1b66000a6c500caa2b085bc0ca976c"}, +] +pyflakes = [ + {file = "pyflakes-2.1.1-py2.py3-none-any.whl", hash = "sha256:17dbeb2e3f4d772725c777fabc446d5634d1038f234e77343108ce445ea69ce0"}, + {file = "pyflakes-2.1.1.tar.gz", hash = "sha256:d976835886f8c5b31d47970ed689944a0262b5f3afa00a5a7b4dc81e5449f8a2"}, +] pygments = [ {file = "Pygments-2.5.2-py2.py3-none-any.whl", hash = "sha256:2a3fe295e54a20164a9df49c75fa58526d3be48e14aceba6d6b1e8ac0bfd6f1b"}, {file = "Pygments-2.5.2.tar.gz", hash = "sha256:98c8aa5a9f778fcd1026a17361ddaf7330d1b7c62ae97c3bb0ae73e0b9b6b0fe"}, diff --git a/pyproject.toml b/pyproject.toml index c900382c..2004453f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,7 @@ mkdocs-material = "^4.6.0" [tool.poetry.dev-dependencies] dependencies = "^0.15" django = "^3.0.2" +flake8 = "^3.7.9" invoke = "^1.4.0" pre-commit = "^1.21.0" stories = "^0.10.1" diff --git a/tasks.py b/tasks.py index d384b48f..257f489b 100644 --- a/tasks.py +++ b/tasks.py @@ -5,18 +5,19 @@ def lint(c): c.run("poetry run pre-commit run -a") c.run("poetry run python -m mddoctest") + c.run("poetry run flake8 .") c.run("poetry run yamllint --strict .") - c.run("npm run lint:css") - c.run("npm run lint:js") - c.run("npm run lint:md") - c.run("npm run lint:pug") + c.run("npx stylelint --ignore-path .gitignore '**/*.css'") + c.run("npx eslint --ext .js --ignore-path .gitignore .") + c.run("npx remark --frail .") + c.run("npx pug-lint **/*.pug") c.run("vale '--glob=*.md' docs") @task def build(c): c.run("poetry run mkdocs build") - c.run("npm run build:slides") + c.run("npx webpack") @task