add pylint to list of required linting tools

With pylint being run in the CI, passing it is required now.
This commit is contained in:
Sarah Hoffmann
2021-01-15 09:04:04 +01:00
parent 8e53f63036
commit de724aa576
4 changed files with 14 additions and 4 deletions

View File

@@ -47,12 +47,16 @@ jobs:
- name: Install test prerequsites - name: Install test prerequsites
run: | run: |
sudo apt-get install -y -qq php-codesniffer sudo apt-get install -y -qq php-codesniffer pylint
sudo pip3 install behave sudo pip3 install behave
- name: PHP linting - name: PHP linting
run: phpcs --report-width=120 . run: phpcs --report-width=120 .
- name: Python linting
run: |
pylint nominatim
- name: PHP unit tests - name: PHP unit tests
run: phpunit ./ run: phpunit ./
working-directory: test/php working-directory: test/php

View File

@@ -155,6 +155,10 @@ if (BUILD_TESTS)
add_test(NAME phpcs add_test(NAME phpcs
COMMAND phpcs --report-width=120 --colors lib website utils COMMAND phpcs --report-width=120 --colors lib website utils
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}) WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
add_test(NAME pylint
COMMAND pylint3 nominatim
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
endif() endif()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------

View File

@@ -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 * for PHP variables use CamelCase with a prefixing letter indicating the type
(i - integer, f - float, a - array, s - string, o - object) (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 ## Testing

View File

@@ -31,6 +31,7 @@ unit tests (using PHPUnit). It has the following additional requirements:
* [behave test framework](https://behave.readthedocs.io) >= 1.2.5 * [behave test framework](https://behave.readthedocs.io) >= 1.2.5
* [phpunit](https://phpunit.de) >= 7.3 * [phpunit](https://phpunit.de) >= 7.3
* [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) * [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)
* [Pylint](https://pylint.org/)
The documentation is built with mkdocs: The documentation is built with mkdocs:
@@ -46,7 +47,7 @@ To install all necessary packages run:
```sh ```sh
sudo apt install php-cgi phpunit php-codesniffer \ 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 pip3 install --user behave mkdocs
``` ```