Skip to content

Commit

Permalink
dev workflow updates for black (#3317)
Browse files Browse the repository at this point in the history
* Add black to dev requirements
* Add black pre-commit hook
* Add black to tox
* Add black to travis-ci
* Added git-blame-ignore-revs file to help keep git blame accurate after reformatting

Signed-off-by: Coady LaCroix <[email protected]>
  • Loading branch information
clacroix12 authored Nov 12, 2020
1 parent c4d5cd5 commit 652cdcd
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Format repository using black
ee4dc48b7f9f5ce54fab47a3c3d9b3dea12c52f1
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
repos:

- repo: https://github.com/psf/black
rev: 20.8b1
hooks:
- id: black
language_version: python3.7

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
hooks:
Expand Down
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ script:

matrix:
include:
- python: 3.7
env: TOXENV=black
- python: 3.6
env: TOXENV=py36
- python: 3.7
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
pre-commit==2.5.1
black==20.8b1
-e .
7 changes: 6 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py36,py37,flake8
envlist = black,py36,py37,flake8

[testenv]
deps =
Expand Down Expand Up @@ -42,3 +42,8 @@ deps =
changedir = docs
skipsdist = true
commands = /usr/bin/make -f Makefile.tox html

[testenv:black]
deps =
black==20.8b1
commands = black . --check

0 comments on commit 652cdcd

Please sign in to comment.