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

Run black and flake over the code and make fixes where needed #8

Merged
merged 5 commits into from Sep 21, 2020

Conversation

TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Sep 21, 2020

Ignore the "black" commit; trust me, it is:

black -l 120 --exclude webtranslate/bottle.py webtranslate scripts/filter_update_langs scripts/lang_sync run ran over the code. Validate if you want to.

The other two commits are the interesting ones.

Copy link
Member

@LordAro LordAro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some thoughts. Feel free to disagree/ignore as you see fit.

I'd remove all the vim fold markers (# {{{ & # }}}) as well - they've been moved around in unhelpful and inconsistent ways

webtranslate/main.py Outdated Show resolved Hide resolved
webtranslate/data.py Show resolved Hide resolved
webtranslate/project_type.py Outdated Show resolved Hide resolved
webtranslate/rights.py Show resolved Hide resolved
webtranslate/users/github.py Outdated Show resolved Hide resolved
This makes the coding standard in the same style, and in line
with PEP-8, and in line with all other projects OpenTTD runs.

bottle.py is excluded, as it is an external library.
Instead of using fold markers that only vim supports to make
the code more readable, a better choice would be to move classes
in their own files in a new folder. This means other editors
also benefit from the better clustering of information.

As currently the markers drifted from their intended purpose,
it is better to remove them and leave the splitting up for an
day.
parameter_info_table is now outside of validation, to keep the manual
spacing. This required moving the classes over multiple files, to
avoid import cycles and keep everything working.
@TrueBrain TrueBrain merged commit 9654edb into OpenTTD:master Sep 21, 2020
@TrueBrain TrueBrain deleted the black branch September 21, 2020 18:05
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.

None yet

3 participants