Skip to content

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 <[email protected]>
@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