-
Notifications
You must be signed in to change notification settings - Fork 26
Introduce python style checks with ruff #395
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
Conversation
95b3d13 to
f3d986d
Compare
This comment was marked as resolved.
This comment was marked as resolved.
f3d986d to
92e7c02
Compare
8eec72a to
44256ed
Compare
This uses a custom CI image also providing ruff.
44256ed to
e9615e8
Compare
|
All problems fixed now. |
| join(self.url, "index.php"), | ||
| params=params | ||
| ) | ||
| params = "&".join("%s=%s" % (k, v) for k, v in search_payload.items()) |
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.
Why do you need this with requests? I am pretty sure passing the search_payload in the params should work out
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.
Please only comment on the changes made in this PR which is only adjusting the style with ruff. I didn't even read the changed code in detail.
| elif status >= 300: | ||
| raise Exception(f"Racktables returned statuscode {status} while trying to access {req.request.url}. Manual investigation needed.") | ||
| raise Exception( | ||
| f"Racktables returned statuscode {status} while trying to access {req.request.url}. Manual investigation needed." |
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.
just for clarity. it meant to be statuscode or status code?
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.
| try: | ||
| print(obj.fqdn, flush=True) | ||
| except: | ||
| except Exception: | ||
| print(obj.common_name, flush=True) |
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.
what Exception is expected here? likely that obj is not defined or something. but it looks to me that the try should enclose the
url_path = result_obj.find("a")["href"]
obj = RacktablesObject(rt)
obj.from_path(url_path)
and not the print. wdyt?
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.
| import json | ||
| import os.path | ||
| import sys | ||
| import re |
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.
this is not related to the style I guess. Maybe a separate commit?
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.
It is related to style changes by removing unused changes. I only applied changes suggested by ruff
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.
Technically @b10n1k is correct. This is not a style change. I assume ruff is not just about coding style and complains about all sorts of "problems".
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.
This is technically not just about style changes.
|
This is not available in leap 15.6, which is unfortunate, since it breaks OBS checks right now. |
No description provided.