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

Increase code style lint #80

Closed
pvk-developer opened this issue Oct 29, 2021 · 1 comment · Fixed by #90
Closed

Increase code style lint #80

pvk-developer opened this issue Oct 29, 2021 · 1 comment · Fixed by #90
Assignees
Labels
internal The issue doesn't change the API or functionality
Milestone

Comments

@pvk-developer
Copy link
Member

Problem Description

Currently our code is being validated only by flake8 'vanilla' and just a few plugins. We would like to increase the code style checks by adding more add-on's that follow our code style and our standards.

Also we would like to ensure that our docstrings are properly written and follow the rest of our format.

Additional context

We have performed this task already on RDT , more precisely on the following issue:
sdv-dev/RDT#248 (comment)

Docstring plugin

We need to add pydocstyle plugin with the following lines on our setup.cfg file as we are following the google convention.

[pydocstyle]
convention = google
add-ignore = D107, D407, D417

Flake8 plugins to be added

Flake8 comes with a lot of different addons that we can use to adapt it to our codestyle and checking, here is a list of plugins that I found to be interesting for us:

  • flake8-builtins - Check for python builtins being used as variables or parameters.
  • flake8-comprehensions - Helps you write better list/set/dict comprehensions.
  • flake8-debugger - Debug statement checker.
  • flake8-variables-names - Extension that helps to make more readable variables names.
  • Dlint - Tool for encouraging best coding practices and helping ensure Python code is secure.
  • flake8-mock - Provides checking mock non-existent methods.
  • flake8-fixme - Check for FIXME, TODO and other temporary developer notes.
  • flake8-eradicate - Plugin to find commented out or dead code.
  • flake8-mutable - Extension for mutable default arguments.
  • flake8-print - Check for print statements in python files.
  • flake8-pytest-style - Plugin checking common style issues or inconsistencies.
  • flake8-quotes - Extension for checking quotes in python.
  • flake8-multiline-containers - Plugin to ensure a consistent format for multiline containers.
  • pandas-vet - Plugin that provides opinionated linting for pandas code.
  • pep8-naming - Check the PEP-8 naming conventions.
  • flake8-expression-complexity - Plugin to validate expressions complexity.
  • flake8-sfs - String formatting.
@fealho
Copy link
Member

fealho commented Nov 5, 2021

@pvk-developer flake8-use-fstring and flake8-docstrings were added to RDT but are not present in the list above. Are they unnecessary?

@fealho fealho mentioned this issue Nov 5, 2021
@fealho fealho closed this as completed in #90 Nov 9, 2021
@pvk-developer pvk-developer added this to the 0.4.0 milestone Nov 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal The issue doesn't change the API or functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants