diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d732c7b..b84dded 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,6 +25,9 @@ Follow the [PEP8 style guide][pep8]. [pep8]: https://www.python.org/dev/peps/pep-0008/ +You can check if your code follows the PEP8, either by running ``make lint`` +or by executing ``flake8`` directly. + FlaskBB is depending on a few python packages for development. One of those is [py.test][pytest] which runs our testsuite. Just use the provided ``requirements-dev.txt`` file and you should be good to go. diff --git a/Makefile b/Makefile index 04dfb79..30065d8 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,11 @@ -.PHONY: clean install help test run dependencies docs +.PHONY: clean install help test lint run dependencies docs help: @echo " clean remove unwanted stuff" @echo " install install dependencies and flaskbb" @echo " devconfig generates a development config" @echo " test run the testsuite" + @echo " lint check the source for style errors" @echo " run run the development server with the development config" @echo " docs build the documentation" @@ -32,3 +33,9 @@ install:dependencies docs: $(MAKE) -C docs html + +lint:check + flake8 + +check: + @type flake8 >/dev/null 2>&1 || echo "Flake8 is not installed. You can install it with 'pip install flake8'." diff --git a/requirements-dev.txt b/requirements-dev.txt index 1795104..bf87aba 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -6,3 +6,4 @@ pytest pytest-cov Sphinx alabaster +flake8