From de724aa57646cad725162bdae56a5a6320cb8ce9 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Fri, 15 Jan 2021 09:04:04 +0100 Subject: [PATCH] add pylint to list of required linting tools With pylint being run in the CI, passing it is required now. --- .github/workflows/ci-tests.yml | 6 +++++- CMakeLists.txt | 4 ++++ CONTRIBUTING.md | 5 +++-- docs/develop/Development-Environment.md | 3 ++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index e57431c0..212707b3 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -47,12 +47,16 @@ jobs: - name: Install test prerequsites run: | - sudo apt-get install -y -qq php-codesniffer + sudo apt-get install -y -qq php-codesniffer pylint sudo pip3 install behave - name: PHP linting run: phpcs --report-width=120 . + - name: Python linting + run: | + pylint nominatim + - name: PHP unit tests run: phpunit ./ working-directory: test/php diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c274594..52c8331d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,6 +155,10 @@ if (BUILD_TESTS) add_test(NAME phpcs COMMAND phpcs --report-width=120 --colors lib website utils WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) + + add_test(NAME pylint + COMMAND pylint3 nominatim + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) endif() #----------------------------------------------------------------------------- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a6145667..552d1da1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,10 +49,11 @@ are in process of consolidating the style. The following rules apply: * for PHP variables use CamelCase with a prefixing letter indicating the type (i - integer, f - float, a - array, s - string, o - object) -The coding style is enforced with PHPCS and can be tested with: +The coding style is enforced with PHPCS and pylint. It can be tested with: ``` - phpcs --report-width=120 --colors . +phpcs --report-width=120 --colors . +pylint3 nominatim ``` ## Testing diff --git a/docs/develop/Development-Environment.md b/docs/develop/Development-Environment.md index 86df1fb9..36b34ccb 100644 --- a/docs/develop/Development-Environment.md +++ b/docs/develop/Development-Environment.md @@ -31,6 +31,7 @@ unit tests (using PHPUnit). It has the following additional requirements: * [behave test framework](https://behave.readthedocs.io) >= 1.2.5 * [phpunit](https://phpunit.de) >= 7.3 * [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) +* [Pylint](https://pylint.org/) The documentation is built with mkdocs: @@ -46,7 +47,7 @@ To install all necessary packages run: ```sh sudo apt install php-cgi phpunit php-codesniffer \ - python3-pip python3-setuptools python3-dev + python3-pip python3-setuptools python3-dev pylint3 pip3 install --user behave mkdocs ``` -- 2.45.2