-
Notifications
You must be signed in to change notification settings - Fork 0
Fix ruff #39
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: master
Are you sure you want to change the base?
Conversation
47eb88e
to
c43ad89
Compare
The great formatting has been done. Added preview rules to the linter/formater. Ignored Rules that caused warnings. added pre-commit-config.yaml. Also let ruff automaticaly by pre commit hook check and format linting stuff. |
], | ||
[ | ||
0, 1, 0, 1, 4, 5, 6, 7, 8, 9, 10, |
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.
Not sure how to adress this one ....... :/
'parameters_start': { | ||
'inlet': { | ||
'c': np.array([0., 1.]), | ||
"parameters_start": { |
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.
Do you prefer single or double quotes?
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.
I feel that double quotes are more standard these days...
tests/test_system.py
Outdated
0, 1, 0, 1, 4, 5, 6, 7, 8, 9, 10, | ||
11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, | ||
22, 23, 24, 25, 26, 22, 23 | ||
0, |
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.
Like one line for every number ? ... mkay
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.
Add trailing comma to avoid line break. (See https://docs.astral.sh/ruff/settings/#format_skip-magic-trailing-comma)
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 wont work for this case, because the entire line is to long. Trailing comma does not prevent line break if line is to long i guess....
state: str | ||
) -> np.ndarray: | ||
self, origin_list: list[(dict, float)], state: str | ||
) -> np.ndarray: |
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.
Add trailing comma to avoid line break. (See https://docs.astral.sh/ruff/settings/#format_skip-magic-trailing-comma).
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.
Good work!
Please add trailing commas to avoid line breaks in some function definitions.
def get_coupled_state(self, | ||
origin_list: list[(dict, float)], | ||
state: str | ||
) -> np.ndarray: |
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.
Add trailing comma to avoid line break. (See https://docs.astral.sh/ruff/settings/#format_skip-magic-trailing-comma)
I removed the automated formatter in the pre commit file. If someone wants to use the autoformater he should handle it by himself with care. Otherwise i specified the directories to check (CadetPythonSim and tests). There a possibilities to ignore rules for specific files by setting:
This will be most likely necessary in Cadet Process. |
d836d57
to
37247c5
Compare
Reworked the optional dependencies and using dependency groups for development related dependencies. |
.github/workflows/ruff.yml
Outdated
@@ -1,17 +1,10 @@ | |||
name: Ruff | |||
on: [ push, pull_request ] | |||
on: [ push ] |
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 remind me, was there a reason not to include this for PRs?
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.
Not a strict reason. I guess i wanted to try to avoid duplicated execution of jobs. Otherwise it would execute this job twice if pushing on a pull_request.
Pull request to fix the linter problem as described in #36 . Added the preview rules that may be unstable but now, ruff linter checks also for things like linespace etc. Also trying to update Ruff pipeline.
Closes #36