Skip to content

Commit 5c290be

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

File tree

6 files changed

+21
-3
lines changed

6 files changed

+21
-3
lines changed

.bumpversion.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ current_version = 0.12.6
33
files = setup.py cachecontrol/__init__.py docs/conf.py
44
commit = True
55
tag = True
6-

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ include
1010
.Python
1111
docs/_build
1212
build/
13-
.tox
13+
.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

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include LICENSE.txt
1+
include LICENSE.txt

dev_requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ cherrypy
66
isort
77
lockfile
88
mock
9+
pre-commit
910
pytest
1011
pytest-cov
1112
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)