Skip to content

PEP8 cleanup needed #308

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

Open
billtubbs opened this issue Jun 8, 2019 · 3 comments
Open

PEP8 cleanup needed #308

billtubbs opened this issue Jun 8, 2019 · 3 comments

Comments

@billtubbs
Copy link
Contributor

billtubbs commented Jun 8, 2019

I noticed a few tab characters in some python script files.

Files with tab characters:

Also, semi-colons are still in use or left-over from Matlab code:

  • genswitch.py
  • statefbk.py
  • config.py
  • frdata.py
  • phaseplot_test.py
  • bdalg.py
  • yottalab.py
  • matlab_test.py

I don't think they affect execution but it's not good practice to have tab characters in python scripts.

@murrayrm
Copy link
Member

murrayrm commented Jun 11, 2019

It would be useful to clean these up eventually. I and others have been updating modules to be more PEP8 compliant as we go through and implement improvements. Fine to continue in that fashion or to selectively do PEP8 updates. It would be good to avoid changing a lot of files at the same time, just because it makes it harder to review and comment on things.

There was an attempt to do this in PR ##283 but it was a bit too aggressive and ultimately withdrawn.

@murrayrm murrayrm changed the title Formatting PEP8 cleanup needed Dec 29, 2019
@dapperfu
Copy link
Contributor

dapperfu commented Mar 4, 2021

One solution to fix this now, and automatically going forward is to leverage an automatic code formatting tool like black.

mongodb's engineering team wrote a series of posts about how they've had a lot of success with automatic code formatting tools. (They're using C++ & Clang-format, but the principles are the same).

But even with smaller projects, most developers discover the problems of working without an agreed upon format the very first time they work on a team. This irritation can lead to religious arguments over the merits of various formatting choices; but mature engineers know that a standard is more important than which standard. - Succeeding With ClangFormat, Part 1: Pitfalls And Planning

I ran black, reorder-python-imports, and cleaned up trailing white spaces on a branch in my fork.

This is the commit diff:

AutomotiveDevOps@312b894

For an established project it is a big bandaid to pull off at once, but after that if you lean on the tooling then it should be smooth thereafter.

@ilayn
Copy link

ilayn commented Mar 4, 2021

black is very successful in nonnumeric codea but unfortunately destroys any array alignment or longer function signatures and long string messages. So makes the code unreadable at some point which we also tried a few times on SciPy code.

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

No branches or pull requests

4 participants