]> git.openstreetmap.org Git - nominatim.git/commitdiff
add pylint to list of required linting tools
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 15 Jan 2021 08:04:04 +0000 (09:04 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 15 Jan 2021 09:43:04 +0000 (10:43 +0100)
With pylint being run in the CI, passing it is required now.

.github/workflows/ci-tests.yml
CMakeLists.txt
CONTRIBUTING.md
docs/develop/Development-Environment.md

index e57431c012db86203e28158af873c95890025552..212707b32b4bdfa48668796199e36031e2283301 100644 (file)
@@ -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
index 1c2745946bcb133a85cf5a95ca24b06a4cd9e36e..52c8331d15a92706fddecf4a52dd0e50db0eab1a 100644 (file)
@@ -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()
 
 #-----------------------------------------------------------------------------
index a61456671986c138d722cbbc17ef67915af4d7a5..552d1da1d285d0676509e385d982e3f1802574b5 100644 (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
    (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
index 86df1fb9661f61545d7d2142eeb78d6783eb4e3c..36b34ccbe76ce4abf8eddf4b36ac54dd64a18a15 100644 (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
 * [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
 ```