Skip to content

Commit

Permalink
Add pre-commit config for formatting and linting
Browse files Browse the repository at this point in the history
Adds a pre-commit config that runs several fixers, including YAPF with
"google" style and pylint for static analysis
  • Loading branch information
ejochman committed Apr 22, 2020
1 parent 268d079 commit 0974aaa
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
27 changes: 27 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3.7

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-docstring-first
- id: name-tests-test
- id: requirements-txt-fixer

- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.29.0
hooks:
- id: yapf
args: [--style=google, --in-place]

- repo: https://github.com/PyCQA/pylint
rev: pylint-2.4.4
hooks:
- id: pylint
args: [--output-format=colorized]
5 changes: 3 additions & 2 deletions src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
cryptography
python-dateutil
distro; sys_platform == 'linux'
filelock
google-api-python-client>=1.7.10
google-auth>=1.11.2
google-auth-httplib2
google-auth-oauthlib>=0.4.1
google-auth>=1.11.2
httplib2>=0.17.0
passlib>=1.7.2; sys_platform == 'win32'
pre-commit
python-dateutil

0 comments on commit 0974aaa

Please sign in to comment.