-
Notifications
You must be signed in to change notification settings - Fork 114
chore: Replace black, isort, flak8 and autoflake by ruff #456
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?
chore: Replace black, isort, flak8 and autoflake by ruff #456
Conversation
|
✅ DCO Check Passed Thanks @schwarbf, all your commits are properly signed off. 🎉 |
Merge ProtectionsYour pull request matches the following merge protections and will not be merged until they are valid. 🔴 Require two reviewer for test updatesThis rule is failing.When test data is updated, we require two reviewers
🟢 Enforce conventional commitWonderful, this rule succeeded.Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
black and isort by ruff| part_name: str | None = Field(default=None) | ||
| docstring: str | None = Field(default=None) | ||
| sha256: int | None = Field(default=None) | ||
| start_line: int | None = Field(default=None) | ||
| end_line: int | None = Field(default=None) | ||
| end_line_signature: int | None = Field(default=None) |
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.
Was this suggested by Ruff?
We still support 3.9 (it may change at some point) and the | syntax is only valid from 3.10. We should therefore keep typing.Optional
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.
Okay I see. It's weird since I had actually set :
[tool.ruff]
target-version = "py39"Anyways, I will revert this part.
Signed-off-by: Florian Schwarb <[email protected]>
Signed-off-by: Florian Schwarb <[email protected]>
Signed-off-by: Florian Schwarb <[email protected]>
Signed-off-by: Florian Schwarb <[email protected]>
Signed-off-by: Florian Schwarb <[email protected]>
Signed-off-by: Florian Schwarb <[email protected]>
…aises fewer issues Signed-off-by: Florian Schwarb <[email protected]>
Signed-off-by: Florian Schwarb <[email protected]>
Signed-off-by: Florian Schwarb <[email protected]>
Signed-off-by: Florian Schwarb <[email protected]>
Signed-off-by: Florian Schwarb <[email protected]>
Signed-off-by: Florian Schwarb <[email protected]>
4c618ea to
85a1889
Compare
Signed-off-by: Florian Schwarb <[email protected]>
Signed-off-by: Florian Schwarb <[email protected]>
Signed-off-by: Florian Schwarb <[email protected]>
…ff (i.e. no separate [tool.flake8] section Signed-off-by: Florian Schwarb <[email protected]>
Signed-off-by: Florian Schwarb <[email protected]>
…= 120 equals now what was set for the .flake8 settings Signed-off-by: Florian Schwarb <[email protected]>
… one linting check would fail Signed-off-by: Florian Schwarb <[email protected]>
Signed-off-by: Florian Schwarb <[email protected]>
|
@ceberam PR should be ready. Let me know if you want me to rebase or merge with |
This PR aims to close the open issue 453.
I tried to do as little code changes as possible. I did the following:
doclingrepositoryblack,isort,autoflakeandflake8ruff format(formatted approx. 30 files) andruff check --fix(fixed approx. 50 warnings)test/datafrom ruffignorelist that would have affected > 3 changes. Feel free to remove any again to see possible changes.120inpyproject.toml(was120in.flake8file, but88inpyproject.toml)FYI: When checking which commit added
ruffto docling, you can see that 5458a88also changed a significant number of files and added some rules to the
ignorelist.