-
Notifications
You must be signed in to change notification settings - Fork 26
[tooling] Switch to ruff #1096
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
base: main
Are you sure you want to change the base?
[tooling] Switch to ruff #1096
Conversation
2546719
to
55e4d58
Compare
@@ -6,7 +6,6 @@ | |||
import flask | |||
from implicitdict import ImplicitDict | |||
from loguru import logger | |||
from uas_standards.astm.f3411.v19.api import ErrorResponse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redefined bellow. I assumed this file version is the one needed ? (message
not optional here)
@@ -42,7 +42,7 @@ | |||
) | |||
from uas_standards.astm.f3548.v21.constants import Scope | |||
|
|||
from monitoring.monitorlib import fetch, infrastructure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defined bellow from fetch.scd (and use scd methods in the file)
@@ -45,7 +45,7 @@ def sub_get_query( | |||
if not fetched_sub.success: | |||
check.record_failed( | |||
summary="Subscription query failed", | |||
details=f"Failed to query subscription {sub_id} referenced by oid {self._oir_a_id} with code {fetched_sub.response.status_code}. Message: {fetched_sub.error_message}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_oir_a_id
is defined in class OIRImplicitSubHandling(TestScenario)
, I did assumed that the scenario
variable
@@ -1128,7 +1128,6 @@ def check_sub_not_none(oir): | |||
check.record_failed( | |||
summary="OIR not attached to any subscription", | |||
details="OIR is not attached to any subscription, when a request for an implicit subscription was made.", | |||
query_timestamps=[mutate_q.timestamp], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably a copy-paste error from others similar methods, I did assume there are no query there.
@@ -39,7 +39,7 @@ def run(self, context): | |||
if not reports: | |||
self.record_note( | |||
"Skip reason", | |||
f"Nominal behavior test scenario report could not be found for any of the scenario types {', '.join(SCENARIO_TYPES)}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scenario type seems to be a find_test_scenario_reports
parameter, who is fixed to NominalBehavior
here. Since 'Nominal behavior' is already in the text I just removed it.
This PR follow #1094
This replace black and isort by ruff.
For now, it use the default ruff configuration + isort. I do plan to add more rules incrementally when they are useful (e.g. pyupgrade) in separate PR to minimize changes.
It's spited in 3 commits:
I also had to apply manual fixes for import (in the second commit) dues to some strange imports of modules / submodules, making some undetected and ruff removing them, but they are 1-1 style-only changes like the rest of the commit.
Mostly tested by the fact that tests are still passing, so parts tests are not done should probably be checked carefully.