Skip to content

Conversation

ZlaTanskY
Copy link
Contributor

PROPOSAL
To have all developers align on codestyle, Python dev's created PEP8 style guide.
Some tools to help enforce this guide are included in this PR:

  • typecheck (mypy)
  • docstyle (pydocstyle)
  • linter (pylint)
  • codestyle (pycodestyle)

By using the Makefile, it is easy to perform these checks by running the following command:
make code-qa

Similarly the unit tests can be run by running the following command:
make test-unit

Other commands can be found and/or added in the Makefile.

@ZlaTanskY ZlaTanskY requested review from sandervh14 and sborms April 22, 2022 07:33
@ZlaTanskY ZlaTanskY mentioned this pull request Apr 26, 2022
@ZlaTanskY
Copy link
Contributor Author

I've not yet worked with black, but it could be a replacer for pylint if you prefer.
See https://github.com/psf/black

@sborms
Copy link
Contributor

sborms commented May 2, 2022

Hi @ZlaTanskY, awesome!

Could we go for black? That was also the conclusion in #54. I too heard good things about it.

@ZlaTanskY ZlaTanskY marked this pull request as draft May 6, 2022 11:39
@ZlaTanskY
Copy link
Contributor Author

ZlaTanskY commented May 20, 2022

I have replaced pylint with black and changed the code accordingly, see 39a28fb

I also added the make command make black-check which will only check for PEP8 violations and not automatically replace them. This way you still have complete control on what would be changed. If you do like the automatic code replacement, you could always add a make command similar to the existing one and leave out the --diff flag.

EDIT: I did not add black into the current code-qa command.

@sborms sborms marked this pull request as ready for review May 23, 2022 14:44
@sborms
Copy link
Contributor

sborms commented May 23, 2022

Looks all good to me! Can you make it merge into the develop branch instead of the master? Then I'll approve it right away. The repo is structured as follows: master (released versions) > develop > issue branches. There's some info here: https://github.com/PythonPredictions/cobra/wiki/Contributing-guidelines-&-workflows.

@ZlaTanskY ZlaTanskY changed the base branch from master to develop May 24, 2022 08:24
@sborms sborms merged commit e04ba90 into develop May 31, 2022
@sborms sborms deleted the feat/pep8 branch May 31, 2022 12:16
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.

2 participants