Skip to content

Commit

Permalink
use pre-commit (lyft#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikonst committed Jan 17, 2019
1 parent 45763f4 commit d977b80
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 5 deletions.
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
hooks:
- id: check-ast
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: flake8
additional_dependencies:
- flake8>=3.6.0,<4
- flake8-bugbear
- flake8-builtins
- flake8-comprehensions
- flake8-commas
- id: trailing-whitespace
- repo: https://github.com/asottile/yesqa
rev: v0.0.8
hooks:
- id: yesqa
additional_dependencies:
- flake8>=3.6.0,<4
- flake8-bugbear
- flake8-builtins
- flake8-comprehensions
- flake8-commas
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
sudo: false
language: python
python:
- '2.7'
- '3.6'
cache:
directories:
- $HOME/.cache/pip
- $HOME/.cache/pre-commit
install:
- pip install -r requirements.txt
- pip install -e .
script: make test

jobs:
include:
- stage: deploy
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ SHELL := /bin/bash
test: test_lint

test_lint:
mkdir -p build
set -o pipefail; flake8 | sed "s#^\./##" > build/flake8.txt || (cat build/flake8.txt && exit 1)
pre-commit run --all-files --show-diff-on-failure
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
flake8==3.5.0
pre-commit

0 comments on commit d977b80

Please sign in to comment.