Commit 5b18910e authored by Guilhem Bonnefille's avatar Guilhem Bonnefille Committed by Pierre Smeyers
Browse files

fix(pylint): use option to ignore generated directories

parent f2c35bc0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -147,7 +147,7 @@ It is bound to the `build` stage, and uses the following variables:
| ------------------------ | ---------------------------------- | ----------------- |
| `pylint-enabled` / `PYLINT_ENABLED` | Set to `true` to enable the `pylint` job                  | _none_ (disabled) |
| `pylint-args` / `PYLINT_ARGS` | Additional [pylint CLI options](http://pylint.pycqa.org/en/latest/user_guide/run.html#command-line-options) |  _none_           |
| `pylint-files` / `PYLINT_FILES` | Files or directories to analyse   | _none_ (by default analyses all found python source files) |
| `pylint-files` / `PYLINT_FILES` | Files or directories to analyse   | . |
| `pylint-severity` / `PYLINT_SEVERITY` | The minimum [pylint message level](https://pylint.readthedocs.io/en/latest/user_guide/messages/#messages-categories) that will fail the job (lower severity findings will appear as a non-failing warning) -  (one of: `fatal`, `error`, `warning`, `convention`, `refactor`, `any`) | `any` |

In addition to a textual report in the console, this job produces the following reports, kept for one day:
+1 −0
Original line number Diff line number Diff line
@@ -80,6 +80,7 @@
        {
          "name": "PYLINT_FILES",
          "description": "Files or directories to analyse",
          "default": ".",
          "advanced": true
        },
        {
+2 −2
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@ spec:
      default: ''
    pylint-files:
      description: Files or directories to analyse
      default: ''
      default: '.'
    pylint-severity:
      description: The minimum [pylint message level](https://pylint.readthedocs.io/en/latest/user_guide/messages/#messages-categories) that will fail the job (lower severity findings will appear as a non-failing warning)
      options:
@@ -1241,7 +1241,7 @@ py-lint:
    - install_requirements
    - _pip install pylint_gitlab # codeclimate reports
    # run pylint and generate reports all at once
    - _run pylint --output-format=colorized,pylint_gitlab.GitlabCodeClimateReporter:reports/py-lint.codeclimate.json,parseable:reports/py-lint.parseable.txt ${PYLINT_ARGS} ${PYLINT_FILES:-$(find -type f -name "*.py" -not -path "./.cache/*" -not -path "./.venv/*")} || exit_code=$?
    - _run pylint --output-format=colorized,pylint_gitlab.GitlabCodeClimateReporter:reports/py-lint.codeclimate.json,parseable:reports/py-lint.parseable.txt ${PYLINT_ARGS} ${PYLINT_FILES} --ignore=.cache,.venv|| exit_code=$?
    # check pylint exit code against $PYLINT_SEVERITY
    - |
      if [[ "${exit_code:-0}" == "0" ]]