Skip to content
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

Fix code related to import statements with isort #1178

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stweil
Copy link
Contributor

@stweil stweil commented Jan 28, 2024

The fix was done in a virtual Python environment:

pip install isort
isort .

It orders the import statements and fixes their formatting.

The fix was done in a virtual Python environment:

    pip install isort
    isort .

It orders the import statements and fixes their formatting.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
@stweil
Copy link
Contributor Author

stweil commented Jan 28, 2024

I think the Python code should follow the PEP 8 style guide.

This pull request supports the intoduction of coding guidelines for the OCR-D code where using isort should be part of.
The same kind of fixes will be necessary for all Python based OCR-D processors as well.

Using flake8 would be a next step. That tool currently reports 14257 issues for core, so the required changes are huge.

@stweil
Copy link
Contributor Author

stweil commented Jan 28, 2024

Tools which can help getting cleaner Python code: https://github.com/life4/awesome-python-code-formatters.

@stweil
Copy link
Contributor Author

stweil commented Jan 28, 2024

OCR-D/format-converters#25 shows how PEP 8 style issues can be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant