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 styleguides for use within Data Science and Statistics #59

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Luke-Williams
Copy link

Added styleguides for Python following the rise of Python usage within Data Science, Analysis and Insight. The content currently includes:

  1. Information on the currently accepted government Python standards, the Quality Assurance of Code for Analysis and Research.
  2. Information on how to setup linting.
  3. A customisable .pylintrc file which can be configured later for standardised linting options.

@jamesgeddes
Copy link

jamesgeddes commented Nov 2, 2021

What do we think about Black? This can automatically PEP8ify your Python.

# paths.
ignore=CVS

# Add files or directories matching the regex patterns to the blacklist. The

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should really use allow list & deny list.

# Specify a score threshold to be exceeded before program exits with error.
fail-under=50

# Add files or directories to the blacklist. They should be base names, not

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should really use allow list & deny list.

# pygtk.require().
#init-hook=

# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Black would be better than Pylint IMO - less to configure and purely PEP8. I get this whole file is for Pylint though 😄

# Pickle collected data for later comparisons.
persistent=yes

# When enabled, pylint would attempt to guess common misconfiguration and emit

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Black needs no config 😄

**What is Linting?**
A lint, or a linter, is a tool that analyzes your code to flag programming errors, bugs and stylistic errors. Simply put, a linter is a tool that scans your code with the goal of finding issues that could lead to bugs or inconsistencies with code health and style.

* You should have as a minimum [pylint](https://pylint.org/#install) installed in order to quality check code before merging any Pull Requests. You can find install instructions on the linked homepage and further setup instructions on their [github page](https://github.com/PyCQA/pylint). Here is a [nice tutorial](http://pylint.pycqa.org/en/latest/tutorial.html) should its usage not be clear.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Linting should be done in a Concourse pipeline. We should encourage local installation, but neither rely on it being installed locally or require it.
  • Could we use Black over Pylint? Is there a specific need for Pylint?

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.

3 participants