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

Add Python Code Linting For gempyor #279

Closed
TimothyWillard opened this issue Aug 2, 2024 · 1 comment
Closed

Add Python Code Linting For gempyor #279

TimothyWillard opened this issue Aug 2, 2024 · 1 comment
Assignees
Labels
gempyor Concerns the Python core. high priority High priority. meta/workflow Relating to CI / issue templates / testing frameworks / etc.

Comments

@TimothyWillard
Copy link
Contributor

Currently there is no enforced style guide for the python code contained in gempyor which can make it difficult to approach the code base for new developers as well as make it challenging to conform code from multiple developers into one cohesive code base. While there is a learning curve associated with these tools and some work to get them setup they will make PR review much smoother and create consistent enforceable guidelines for contributing.

There are multiple options, but I suggest we use black autoformatter and/or pylint static analyzer to clean up gempyor and enforce consistent styling. pylint seems to be much stricter then black, but black has the ability to reformat your code for you. Perhaps a compromise approach is starting with black and then upgrading to pylint. But some general steps that need to be taken are:

  1. Apply black to the python code base.
  2. Write documentation on how to use black, probably in the contributing portion of the gitbook documentation.
  3. Add a check for code formatting correctness to a github action.
  4. Eventually upgrade to using pylint either going file by file or limiting to --errors-only initially.
@TimothyWillard
Copy link
Contributor Author

Immediate issue addressed in GH-358, succeeded by GH-398, GH-399.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gempyor Concerns the Python core. high priority High priority. meta/workflow Relating to CI / issue templates / testing frameworks / etc.
Projects
None yet
Development

No branches or pull requests

1 participant