diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e6e23c87..7aaed8de 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,3 +3,14 @@ repos: rev: 19.3b0 hooks: - id: black + - repo: https://gitlab.com/pycqa/flake8 + rev: 3.7.7 + hooks: + - id: flake8 + additional_dependencies: [flake8-bugbear] + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.1.0 + hooks: + - id: check-byte-order-marker + - id: trailing-whitespace + - id: end-of-file-fixer diff --git a/docs/Makefile b/docs/Makefile index fc19e49d..23de2666 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -17,4 +17,4 @@ help: # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/flaskstyle.sty b/docs/flaskstyle.sty index cd53c898..0c4817ed 100644 --- a/docs/flaskstyle.sty +++ b/docs/flaskstyle.sty @@ -9,7 +9,7 @@ \begin{titlepage}% \let\footnotesize\small \let\footnoterule\relax - % Apply following fix only on PDF output, i.e. pdfoutput macro is not + % Apply following fix only on PDF output, i.e. pdfoutput macro is not % undefined \ifx\pdfoutput\undefined\else \begingroup diff --git a/docs/patterns/appfactories.rst b/docs/patterns/appfactories.rst index b2815d91..d8efba76 100644 --- a/docs/patterns/appfactories.rst +++ b/docs/patterns/appfactories.rst @@ -93,13 +93,13 @@ To run such an application, you can use the :command:`flask` command:: $ export FLASK_APP=myapp $ flask run - -Flask will automatically detect the factory (``create_app`` or ``make_app``) + +Flask will automatically detect the factory (``create_app`` or ``make_app``) in ``myapp``. You can also pass arguments to the factory like this:: $ export FLASK_APP="myapp:create_app('dev')" $ flask run - + Then the ``create_app`` factory in ``myapp`` is called with the string ``'dev'`` as the argument. See :doc:`/cli` for more detail. diff --git a/setup.cfg b/setup.cfg index 0349ab94..8aca7e33 100644 --- a/setup.cfg +++ b/setup.cfg @@ -22,3 +22,27 @@ source = flask .tox/*/lib/python*/site-packages/flask .tox/pypy/site-packages/flask + +[flake8] +# B = bugbear +# E = pycodestyle errors +# F = flake8 pyflakes +# W = pycodestyle warnings +# B9 = bugbear opinions +select = B, E, F, W, B9 +ignore = + # slice notation whitespace, invalid + E203 + # import at top, too many circular import fixes + E402 + # line length, handled by bugbear B950 + E501 + # bare except, handled by bugbear B001 + E722 + # bin op line break, invalid + W503 +# up to 88 allowed by bugbear B950 +max-line-length = 80 +per-file-ignores = + # __init__ modules export names + **/__init__.py: F401 diff --git a/tests/templates/template_filter.html b/tests/templates/template_filter.html index af46cd94..d51506a3 100644 --- a/tests/templates/template_filter.html +++ b/tests/templates/template_filter.html @@ -1 +1 @@ -{{ value|super_reverse }} \ No newline at end of file +{{ value|super_reverse }}