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

Power up pre-commit #237

Merged
merged 2 commits into from
Dec 12, 2019
Merged

Power up pre-commit #237

merged 2 commits into from
Dec 12, 2019

Conversation

basnijholt
Copy link
Member

@basnijholt basnijholt commented Dec 11, 2019

This adds some whitespace checks, isort, pyupgrade, and some other code checks from the pre-commit-hooks repo.

Note that pyupgrade doesn't really change much here because I used this already before.

A summary of what the hooks do:

  • pyupgrade - A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language.
  • end-of-file-fixer - Makes sure files end in a newline and only a newline.
  • check-docstring-first - Checks for a common error of placing code before the docstring.
  • check-yaml - Attempts to load all yaml files to verify syntax.
  • debug-statements - Check for debugger imports and py37+ breakpoint() calls in python source.
  • check-ast - Simply check whether files parse as valid python.
  • seed-isort-config - Statically populate the known_third_party isort setting because isort sucks at figuring out which third party libs are used. (from author of pre-commit)

I have also added this summary to the first commit.

@basnijholt basnijholt force-pushed the power-up-pre-commit branch 2 times, most recently from bafb6d7 to 32dbbf7 Compare December 11, 2019 13:06
@basnijholt basnijholt requested a review from jbweston December 11, 2019 13:07
@basnijholt basnijholt force-pushed the power-up-pre-commit branch 4 times, most recently from 3dab38a to 7c5e689 Compare December 11, 2019 14:25
.isort.cfg Show resolved Hide resolved
.pre-commit-config.yaml Show resolved Hide resolved
A summary of what the hooks do:
* `pyupgrade` - A tool (and pre-commit hook) to automatically upgrade syntax for newer versions of the language.
* `end-of-file-fixer` - Makes sure files end in a newline and only a newline.
* `check-docstring-first` - Checks for a common error of placing code before the docstring.
* `check-yaml` - Attempts to load all yaml files to verify syntax.
* `debug-statements` - Check for debugger imports and py37+ breakpoint() calls in python source.
* `check-ast` - Simply check whether files parse as valid python.
* `seed-isort-config` - Statically populate the `known_third_party` `isort` setting because `isort` sucks at figuring out which third party libs are used. (from author of `pre-commit`)
@jbweston jbweston merged commit 9636234 into master Dec 12, 2019
@basnijholt basnijholt deleted the power-up-pre-commit branch December 18, 2019 12:36
@basnijholt basnijholt mentioned this pull request Jan 16, 2020
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.

2 participants