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 pre-commit config #82

Merged
merged 10 commits into from
Apr 23, 2020
Merged

Add pre-commit config #82

merged 10 commits into from
Apr 23, 2020

Conversation

Mattwmaster58
Copy link
Member

@Mattwmaster58 Mattwmaster58 commented Apr 16, 2020

This PR adds a .pre-commit-config.yaml to be used by pre-commit to enforce rules and format files. Hooks:

  • trailing-whitespace
    • removes trailing whitespace
  • end-of-file-fixer
    • fixes files to end with newline
  • check-yaml
    • checks that all YAML files are valid
  • check-toml
    • checks that all TOML files are valid
  • check-builtin-literals
    • checks that builtin literals (eg checks that {'i': 1} is used over dict(i=1))
  • debug-statements
    • check for breakpoint() and other debugging imports
  • isort
    • sorts imports nicely
  • black
    • format with black

Also included:

  • tox.ini change so that we simply check if the pre-commit conditions are met.
  • CONTRIBUTING.md update so that people are encouraged to use pre-commit hooks

Enabling these hooks is as easy as installing pre-commit and running pre-commit install

@Mattwmaster58 Mattwmaster58 changed the base branch from dev to pup2.1.1 April 16, 2020 04:52
@Mattwmaster58 Mattwmaster58 added the enhancement New feature or request label Apr 16, 2020
@Mattwmaster58 Mattwmaster58 marked this pull request as ready for review April 16, 2020 17:22
@Mattwmaster58 Mattwmaster58 marked this pull request as draft April 16, 2020 17:33
@Mattwmaster58 Mattwmaster58 marked this pull request as ready for review April 16, 2020 18:32
@Mattwmaster58
Copy link
Member Author

gah! accidentally committed some files that were formatted using black with an incorrect configuration.

Should be good now.

@Granitosaurus
Copy link
Contributor

Looks good!

@Mattwmaster58 Mattwmaster58 merged commit cd5af73 into pup2.1.1 Apr 23, 2020
@Mattwmaster58 Mattwmaster58 deleted the code_quality branch April 23, 2020 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants