j0ono0/pinout

[Discussion] Decide on coding styles and apply PyCQA + Pytest

Opened this issue · 4 comments

To improve consistency and readbility with external contributions let us add

  • A contributors file
  • Add some combination of linting and code-quality analysis via CI
  • Start working on a small test suite to check stability on PR's

I would work on all these as time allows.

They all sound like things I should read up on!
I'm regularly rewriting large chunks of the core code - might be a good time to learn, and implement, testing processes and try out some linting.

@whatnick any recommendations on style/linting to conform to?
[EDIT]
I'm trying out flake8
...Now trying out Black.
Looks like Black did everything except long docs strings when cross-checked with flake8.
Black looks good at first glance, I'll try it out more on my local dev files. Looks like it is the 'cool kid on the block' too and got a mention by Guido van Rossum in a github discussion thread. <+2 appeal>

I'm open to suggestion on what will be appealing for other developers. What's typical implementation? Auto format on git push/pull requests? check and pass/reject on submission?

Typical PyCQA settings are

  • A pre-commit hook on developer machines to reject failing code
  • A lint github action on push / on PR to maintain clean main branch from external contributions
  • Shed is a fully opinionated option, most projects I work on use isort, flake8, black and pylint. Pylint is perhaps the heaviest lift.

Checked out pylint - annoying. pedantic. -but- I can see the benefit and think It'll be worth enforcing style consistency with it. I've only read-up on isort but it also sounds like a good move - if only because I occasionally waste time pondering import sort order!

I'll see if I can get my current dev branch (0.0.9) into a passable format.