-
Notifications
You must be signed in to change notification settings - Fork 152
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
Refactor Command.run() #2467
Merged
Merged
Refactor Command.run() #2467
Commits on Feb 19, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 33e1bfd - Browse repository at this point
Copy the full SHA 33e1bfdView commit details -
Configuration menu - View commit details
-
Copy full SHA for f6fe146 - Browse repository at this point
Copy the full SHA f6fe146View commit details -
Refactor Command.run() to return None if cmd not found
Command.run() currently has a bit of a confusing behavior: if raise_on_error is False and the executable is not found, then a weird CommandT is returned (return code is -1 and stdout+stderr is None). This makes it possible to hanlde command not found errors separately, but it makes that needlessly verbose. So instead, let's just return None in *this* special case. That in turn uncovered, that in most cases when we set `raise_on_error=True`, we actually want an error if the command is not present but no error if the command fails to execute (e.g. because it returns -1 if you run `$cmd --version` 🙄). Hence we introduce the flag `raise_on_command_not_found`, which causes an exception to be raised if the command is not found. This makes it independent of the `raise_on_error` flag. Additionally, we add a small optimization: if command starts with /, then we assume it's a full path and we omit the call to which (and just check whether it exists). These changes require additional tests and a few assertions in places where mypy cannot infer that a certain value is of the correct type.
Configuration menu - View commit details
-
Copy full SHA for 6e5ebe3 - Browse repository at this point
Copy the full SHA 6e5ebe3View commit details -
Configuration menu - View commit details
-
Copy full SHA for ced604a - Browse repository at this point
Copy the full SHA ced604aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 74f2c84 - Browse repository at this point
Copy the full SHA 74f2c84View commit details -
Configuration menu - View commit details
-
Copy full SHA for b4174c8 - Browse repository at this point
Copy the full SHA b4174c8View commit details -
Configuration menu - View commit details
-
Copy full SHA for e5ce72b - Browse repository at this point
Copy the full SHA e5ce72bView commit details -
Configuration menu - View commit details
-
Copy full SHA for e31308b - Browse repository at this point
Copy the full SHA e31308bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0cb6a3d - Browse repository at this point
Copy the full SHA 0cb6a3dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4dcc0db - Browse repository at this point
Copy the full SHA 4dcc0dbView commit details -
Allow empty cherry-picks for compliance test
If we cherry-pick from main to master the compliance check will notice that a commit already exists. This is not an error and we can allow to continue the picking via --allow-empty
Configuration menu - View commit details
-
Copy full SHA for ea568f9 - Browse repository at this point
Copy the full SHA ea568f9View commit details -
Revert "py3.7 is out of scope for the tests"
This reverts commit 4dcc0db.
Configuration menu - View commit details
-
Copy full SHA for 5753b9f - Browse repository at this point
Copy the full SHA 5753b9fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 899b1d3 - Browse repository at this point
Copy the full SHA 899b1d3View commit details
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.