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

CP-49928/static-vdis: Fix pyright (3/3 of: prepare move to python3/) #5731

Conversation

bernhardkaindl
Copy link
Collaborator

@bernhardkaindl bernhardkaindl commented Jun 25, 2024

static-vdis: Fix pyright and pylint warnings before moving static-vdis to python3/.

For information: @ashwin9390

@bernhardkaindl bernhardkaindl changed the base branch from master to feature/py3 June 25, 2024 14:15
@bernhardkaindl bernhardkaindl force-pushed the static-vdis-pyright-fresh_name-not-None branch 3 times, most recently from 76f70d0 to c8f054c Compare June 25, 2024 15:28
@psafont
Copy link
Member

psafont commented Jun 25, 2024

The ocaml failure is fixed with #5726 Longer term a merge from master is needed

Copy link
Collaborator Author

@bernhardkaindl bernhardkaindl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • commit 1 needs to be merged to fix pytype warnings before it's possible to move.
  • commits 2, 3 and 4 are optional, but they fix warnings that should be fixed (if possible).

@bernhardkaindl bernhardkaindl changed the title static-vdis: Fix warnings before attempting to move it to python3/ (1 of many) CP-49928/static-vdis: Fix warnings (prepare move to python3/: all 5 commits) Jun 27, 2024
@bernhardkaindl bernhardkaindl changed the title CP-49928/static-vdis: Fix warnings (prepare move to python3/: all 5 commits) CP-49928/static-vdis: Fix pyright (3/3 of: prepare move to python3/) Jun 27, 2024
Warning fix (for pyright) in scripts/static-vdis:
- fresh_name is covered by github.com/xapi-project/pull/5740

Details: Always return a value in fresh_name():
- Was already so, but pyright doesn't "understand" this.
- Fix the warning by de-indenting `return 0` of fresh_name()

Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
- all does not need to be initialized to an empty list:
  It isn't used before it is set by `all = listdir(...)` and not after.

- Use `if i not in files:` not some clumsy method that pylint warns on.

Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
Signed-off-by: Bernhard Kaindl <bernhard.kaindl@cloud.com>
@bernhardkaindl bernhardkaindl removed the request for review from contificate July 2, 2024 13:26
@psafont psafont merged commit 2f83515 into xapi-project:feature/py3 Jul 2, 2024
14 checks passed
@bernhardkaindl bernhardkaindl deleted the static-vdis-pyright-fresh_name-not-None branch July 2, 2024 13:31
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.

4 participants