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

fix(mypy): use exclude option to exclude generated directories

parent 92fa5aef
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -393,7 +393,7 @@ It is bound to the `build` stage, and uses the following variables:
| ------------------------ | ---------------------------------- | ----------------- |
| `mypy-enabled` / `MYPY_ENABLED` | Set to `true` to enable the `mypy` job                  | _none_ (disabled) |
| `mypy-args` / `MYPY_ARGS` | Additional [mypy CLI options](https://mypy.readthedocs.io/en/stable/command_line.html) | _none_           |
| `mypy-files` / `MYPY_FILES` | Files or directories to analyse   | _none_ (by default analyses all found python source files) |
| `mypy-files` / `MYPY_FILES` | Files or directories to analyse   | . |

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
@@ -328,6 +328,7 @@
        {
          "name": "MYPY_FILES",
          "description": "Files or directories to analyse",
          "default": ".",
          "advanced": true
        }
      ]
+2 −2
Original line number Diff line number Diff line
@@ -205,7 +205,7 @@ spec:
      default: ""
    mypy-files:
      description: Files or directories to analyse
      default: ''
      default: '.'
    pyright-enabled:
      description: Enable pyright
      type: boolean
@@ -1376,7 +1376,7 @@ py-mypy:
    - mkdir -p -m 777 reports
    - install_requirements
    - _pip install mypy mypy-to-codeclimate
    - _run mypy ${MYPY_ARGS} ${MYPY_FILES:-$(find -type f -name "*.py" -not -path "./.cache/*" -not -path "./.venv/*")} | tee reports/py-mypy.console.txt || true
    - _run mypy ${MYPY_ARGS} ${MYPY_FILES} --exclude /.cache/ --exclude /.venv/ | tee reports/py-mypy.console.txt || true
    # mypy-to-codeclimate will fail if any error was found
    - _run mypy-to-codeclimate reports/py-mypy.console.txt reports/py-mypy.codeclimate.json
  artifacts: