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

Introduce project guidelines: code style, docstring style, formatter, linter, etc. #20

Closed
majabojarska opened this issue Mar 6, 2021 · 4 comments · Fixed by #30
Closed

Comments

@majabojarska
Copy link
Collaborator

As this little project is gaining traction, it would be good to introduce code guidelines. Specifically docstring style, formatting and linting tools. Everyone has some coding habits and prefers some tools over other. However, in a project it would be best to agree on some rules, just to keep the codebase clean and uniform.

This is obviously a topic for discussion. From my side, I'd like to propose the following:

  • PEP8 code style, as it's the official Python style guide. To check for code style compliance, a linter should be used, such as Flake8 or Pylint. Both check the code against PEP8. Pylint is stricter, but also more elastic. Both Flake8 and Pylint can be tweaked if necessary. I would go with Pylint after all.
  • Black formatter, as it is PEP8-compliant and has sensible defaults. It can be run also as a pre-commit Git hook to format the codebase on commit. Integrates well with various editors and IDEs.
  • Numpy docstring style. It's pretty common and well supported. Can be paired with Darglint to lint docstrings.

The above guidelines can be later described via a CONTRIBUTING.md file together with the preferred contributing workflow.

@Prayag2
Copy link
Owner

Prayag2 commented Mar 10, 2021

OOOOHHHH this is awesome! I didn't know about any of these! The last one is really amazing! I never knew that I needed it so much! Thank you!! I learnt a lot from you!

@Prayag2
Copy link
Owner

Prayag2 commented Mar 10, 2021

Please have a look at #27

@majabojarska
Copy link
Collaborator Author

#27 Is already merged. I left some feedback over there.

@majabojarska
Copy link
Collaborator Author

Added Black and PyLint as dev requirements in #30.

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 a pull request may close this issue.

2 participants