Skip to content

Conversation

@bernhardkaindl
Copy link
Contributor

@bernhardkaindl bernhardkaindl commented Mar 19, 2025

Hello @freddy77!

As written before, this PR only adds new files for code checks, so it should not cause conflicts.

I successfully tested mypy and pyright in GitHub CI!

Here is a sample (private) PR that shows an intentional CI failure that generated an automated code review comment for the intentionally added broken code:

xenserver-next#1
xenserver-next#1 (comment)

Besides the comments from mypy and pyright (Microsoft's code checker) that I tested on this PR,
I also integrated the pylint and pytype checkers.

All checkers also work locally with minimal effort by using pre-commit.
It is a battle-hardened CI solution that installs Python environments for
each CI check and runs the checks in their respective environment.

Howto:

  • Installation:
    • Ubuntu 24.04 and similar: sudo apt install pipx;pipx install pre-commit
    • Older distributions: pip install pre-commit (if your system allows it)
  • Full initial run (including Python environment creation+installation): pre-commit run -av
  • Incremental runs the current state of the local work tree: pre-commit run.

@bernhardkaindl bernhardkaindl requested a review from freddy77 March 19, 2025 16:17
@bernhardkaindl bernhardkaindl force-pushed the pytype-mypy-pylint-pre-commit-code-checks branch from f04a5f0 to 42cce9e Compare March 19, 2025 17:41
Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
@bernhardkaindl bernhardkaindl force-pushed the pytype-mypy-pylint-pre-commit-code-checks branch 5 times, most recently from 16059c1 to 2ed5ad6 Compare March 19, 2025 18:40
@bernhardkaindl bernhardkaindl force-pushed the pytype-mypy-pylint-pre-commit-code-checks branch from 2ed5ad6 to ebbf3fd Compare March 19, 2025 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant