Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Annotations for shellcheck and ruff + enable pyright (without static type checking) #205

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Root-Core
Copy link
Contributor

Cherry-picked and adopted from #152

As discussed in #204 Pyright is able to check the imports, without checking types. I'm not sure what else is tested, but imports are.

@R1kaB3rN
Copy link
Member

R1kaB3rN commented Jan 9, 2025

Why doesn't pyright error on resolution?

@R1kaB3rN
Copy link
Member

R1kaB3rN commented Jan 9, 2025

I expected the warning:

Import "protonfixes" could not be resolved (reportMissingImports)

to have the workflow fail, which doesn't. I guess it's just a matter of configuring pyright?

@Root-Core
Copy link
Contributor Author

Root-Core commented Jan 9, 2025

Github checks against unchanged files I guess. Therefore these are only warnings.. or the warning level is not high enough / pyright doesn't fail.

0 errors, 392 warnings, 0 informations
··• echo $?
0

Yeah.. they aren't errors. I think we could configure pyright to handle them as errors.

@R1kaB3rN
Copy link
Member

Github checks against unchanged files I guess. Therefore these are only warnings.. or the warning level is not high enough / pyright doesn't fail.

0 errors, 392 warnings, 0 informations
··• echo $?
0

Yeah.. they aren't errors. I think we could configure pyright to handle them as errors.

Yeah, we can look into that later.

@Root-Core
Copy link
Contributor Author

Root-Core commented Jan 10, 2025

I changed the configuration to be as strict as possible regarding imports and handle everything as an error.
// Rebased

PS: It's expected, that the CI fails. That's fixed with #200.

This prevents subsequent errors and fixes errors thrown by static code analysis.
- enable static type checking via pyright-action
- added pyproject.toml with basic meta data and pyright configuration
- use action-shellcheck instead of installing it manually
- use ruff-action instead of installing it manually
- Cache pip dependencies
@Root-Core Root-Core force-pushed the refactor_ci_pyright branch from ad92f42 to 44d4f5f Compare January 10, 2025 00:16
@Root-Core Root-Core changed the title Refactor: Enable pyright without static type checking and annotations for shellcheck and ruff Refactor: Annotations for shellcheck and ruff + enable pyright (without static type checking) Jan 10, 2025
@Root-Core Root-Core changed the title Refactor: Annotations for shellcheck and ruff + enable pyright (without static type checking) CI: Annotations for shellcheck and ruff + enable pyright (without static type checking) Jan 10, 2025
@Root-Core
Copy link
Contributor Author

Root-Core commented Jan 10, 2025

Using the symbolic link in combination with extraPaths[] works.
I still think the relative imports are a better solution, but this does the trick for now, and we could skip most of #200.

Or have you tested the changes in #200 and concluded that they work and are indeed a "better" solution? :)

BTW: Since the gamefixes work inside proton / fix.py, I guess you could still adapt your script to handle them just like fix.py does. Or even call functions in fix.py like the unit test does.

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.

2 participants