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

Fixup genutil.py #307

Closed
wants to merge 8 commits into from
Closed

Conversation

Serial-ATA
Copy link

This is part of #306 (comment).

There are no functionality changes, these are purely stylistic and QOL changes.

I started with genutil.py, since it's used everywhere.

This PR:

  • Adds type annotations everywhere
  • Removes some dead code
  • Fixes up and improves some doc comments
  • Fixes inconsistent formatting of the file

See the commit messages for explanations of the changes made.

Signed-off-by: Alexander McClain <[email protected]>
`skip_junk` and `print_runs` were not used anywhere.

Signed-off-by: Alexander McClain <[email protected]>
To follow the same naming convention as the surrounding functions.

Signed-off-by: Alexander McClain <[email protected]>
The file had many formatting issues, the main ones being:

1. Many functions had 3 space indentation, which is inconsistent with the
   rest of the file's 4 space indentation.
2. No spaces between list and tuple elements
3. Extra spaces around list and tuple elements
4. Lack of space between function definitions (2 newlines is recommended)

Signed-off-by: Alexander McClain <[email protected]>
There doesn't seem to be a need to manually write to stderr and exit here.

Signed-off-by: Alexander McClain <[email protected]>
This just makes it easier to visualize what these do.

Signed-off-by: Alexander McClain <[email protected]>
@marjevan
Copy link
Member

Thanks for the great work.
I added a few more changes like Python 3.8 support (list[] -> List[]).

The changes will be available with the next XED external release.

@marjevan marjevan marked this pull request as draft November 20, 2023 14:10
@Serial-ATA
Copy link
Author

The changes will be available with the next XED external release.

Thanks. Is there a planned release date? I'd like to have the current state of genutil.py before continuing to add types to other files.

@marjevan
Copy link
Member

Thanks. Is there a planned release date? I'd like to have the current state of genutil.py before continuing to add types to other files.

Early December

@sdeadmin sdeadmin closed this in 2b5c29a Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants