Skip to content

Commit 190d7de

Browse files
committed
Set up [pre-commit](https://pre-commit.com/).
This includes isort, black and some basic hygiene on text files.
1 parent 545c5e3 commit 190d7de

File tree

5 files changed

+20
-2
lines changed

5 files changed

+20
-2
lines changed

.bumpversion.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ current_version = 0.12.6
77
files = setup.py cachecontrol/__init__.py docs/conf.py
88
commit = True
99
tag = True
10-

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ include
1414
.Python
1515
docs/_build
1616
build/
17-
.tox
17+
.tox

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v2.3.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- repo: https://github.com/timothycrosley/isort
9+
rev: 4.3.21
10+
hooks:
11+
- id: isort
12+
additional_dependencies:
13+
- toml
14+
- repo: https://github.com/python/black
15+
rev: 19.10b0
16+
hooks:
17+
- id: black

dev_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ cherrypy
1010
isort
1111
lockfile
1212
mock
13+
pre-commit
1314
pytest
1415
pytest-cov
1516
redis

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[tool.isort]
22
line_length = 88
33
known_first_party = ['cachecontrol']
4+
known_third_party = ['mock', 'lockfile', 'requests', 'pytest', 'msgpack', 'cherrypy']
45
# Set multi-line output to "Vertical Hanging indent" to avoid fighting with black.
56
multi_line_output = 3
67
include_trailing_comma = true

0 commit comments

Comments
 (0)