Skip to content

Fix code related to import statements with isort#1178

Open
stweil wants to merge 1 commit into
OCR-D:masterfrom
stweil:isort
Open

Fix code related to import statements with isort#1178
stweil wants to merge 1 commit into
OCR-D:masterfrom
stweil:isort

Conversation

@stweil

@stweil stweil commented Jan 28, 2024

Copy link
Copy Markdown
Contributor

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

stweil commented Jan 28, 2024

Copy link
Copy Markdown
Contributor Author

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

stweil commented Jan 28, 2024

Copy link
Copy Markdown
Contributor Author

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

@stweil

stweil commented Jan 28, 2024

Copy link
Copy Markdown
Contributor Author

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