diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 55d9f0abd7a..321eea335bc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -194,3 +194,45 @@ jobs: github_token: ${{ secrets.github_token }} reporter: github-pr-review level: error + + # uses: tsuyoshicho/action-mypy@v3.13.0 + - uses: bernhardkaindl/action-mypy@36cb3a857d01c1bdaa2811893106c71580132d71 + with: + filter_mode: no_filter + setup_method: install + setup_command: pip install mypy mock + mypy_flags: | + --scripts-are-modules + --check-untyped-defs + --allow-redefinition + --hide-error-context + --ignore-missing-imports + --no-pretty + --warn-unreachable + --exclude ocaml/ + --exclude scripts/examples + --exclude scripts/examples/python/monitor-unwanted-domains.py + --exclude scripts/scalability-tests/ping-master.py + --exclude scripts/backup-sr-metadata.py + --exclude scripts/restore-sr-metadata.py + --exclude scripts/nbd_client_manager.py + --config-file mypy.ini + target: | + scripts/perfmon + scripts/hfx_filename + scripts/mail-alarm + scripts/host-display + github_token: ${{ secrets.github_token }} + reporter: github-pr-review + + - uses: dciborow/action-pylint@0.1.1 + with: + filter_mode: no_filter + glob_pattern: "scripts/*" + pylint_args: | + --verbose + --disable=trailing-whitespace + --disable=bad-indentation + --rc .pylintrc + github_token: ${{ secrets.github_token }} + reporter: github-pr-review diff --git a/pyproject.toml b/pyproject.toml index f155e2a0641..2cc7b1ad9b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,6 @@ ensure_newline_before_comments = false # PYTHONPATH="scripts/examples/python:.:scripts:scripts/plugins:scripts/examples" files = [ "scripts/usb_reset.py", - "scripts/unit_tests", ] pretty = true error_summary = true @@ -70,8 +69,6 @@ discard_messages_matching = [ "No Node.TEXT_NODE in module xml.dom.minidom, referenced from 'xml.dom.expatbuilder'" ] expected_to_fail = [ - "scripts/hfx_filename", - "scripts/perfmon", # Need 2to3 -w and maybe a few other minor updates: "scripts/hatests", "scripts/backup-sr-metadata.py", @@ -112,13 +109,12 @@ inputs = [ "scripts/xe-scsi-dev-map", "scripts/examples/python", "scripts/yum-plugins", - "scripts/*.py", - # To be added later, # when converted to Python3-compatible syntax: # "ocaml/message-switch/python", # "ocaml/idl/ocaml_backend/python", # "ocaml/xapi-storage/python", + # "ocaml/xenopsd/python", ] disable = [ "import-error", # xenfsimage, xcp.bootloader. xcp.cmd