-
Notifications
You must be signed in to change notification settings - Fork 26
Fix and improve Python style #493
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
Open
okurz
wants to merge
44
commits into
os-autoinst:master
Choose a base branch
from
okurz:feature/bash_to_python1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"shellcheck" itself is still having an explicit rule as it must exclude test files.
…pecific exception Replaced print statements with logging.info for better output management. Replaced generic 'except Exception' with 'except AttributeError' for more specific error handling. fixup logging get_unused_machines
…tion handling * Added 'from __future__ import annotations', 'from pathlib import Path', and 'from typing import Optional' imports. * Added type hints to all method arguments and return values. * Replaced 'os.path.join' with 'Path(...).joinpath(...)' * Replaced generic 'Exception' with 'requests.HTTPError' for more specific exception handling. * Refactored the 'RacktablesObject.from_path' method to avoid blind exception catching inside a loop, addressing S110 and BLE001 rules. * Fixed E501 line length issues.
…get_unused_machines.py
* Replaced all print statements with logging.info for better output management. * Replaced subprocess.call with subprocess.run for better error handling. * Added noqa: S603 to suppress security warnings, as the command input is trusted. * Replaced os.path.join with pathlib.Path (PTH118) * Added timeout to requests calls (S113) * Refactored the loop for populating 'machines_to_power_on' to use list.extend and a list comprehension. * Add missing copyright
…enqa-bats-review.py
…o_common_failures
Modified the function within to accept arbitrary keyword arguments (). This resolves the caused by passing unexpected arguments to the side effect function.
…common_failures Adjusted the argument signature of to match the number of arguments passed by the decorators. This resolves issues in .
Also adding a "RUNNER" make variable that defaults to "uv run" but can also be overwritten, e.g. to just an empty string to use the current Python environment.
…rigger_bisect_jobs.py
Reformatted long string assignments in the function to adhere to the 120-character line length limit. This addresses the E501 style warnings.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.