File tree Expand file tree Collapse file tree 4 files changed +55
-4
lines changed Expand file tree Collapse file tree 4 files changed +55
-4
lines changed Original file line number Diff line number Diff line change 2
2
* .swp
3
3
.DS_Store
4
4
.git_submodule_init.done.log
5
+ .venv-pre-commit
5
6
__pycache__
6
7
build
7
8
dist
Original file line number Diff line number Diff line change
1
+ repos :
2
+ - repo : https://github.com/psf/black
3
+ rev : 22.10.0
4
+ hooks :
5
+ - id : black
6
+ - repo : https://github.com/pycqa/flake8
7
+ rev : 5.0.4
8
+ hooks :
9
+ - id : flake8
10
+ - repo : https://github.com/pycqa/isort
11
+ rev : 5.10.1
12
+ hooks :
13
+ - id : isort
14
+ name : isort (python)
Original file line number Diff line number Diff line change @@ -15,8 +15,8 @@ SHELL := /bin/bash
15
15
16
16
PYTHON3 ?= python3
17
17
18
- # This recipe intentionally blank.
19
- all :
18
+ all : \
19
+ .venv-pre-commit/var/.pre-commit-built.log
20
20
21
21
.PHONY : \
22
22
download
33
33
.git_submodule_init.done.log
34
34
touch $@
35
35
36
+ # This virtual environment is meant to be built once and then persist, even through 'make clean'.
37
+ # If a recipe is written to remove this flag file, it should first run `pre-commit uninstall`.
38
+ .venv-pre-commit/var/.pre-commit-built.log :
39
+ rm -rf .venv-pre-commit
40
+ test -r .pre-commit-config.yaml \
41
+ || (echo " ERROR:Makefile:pre-commit is expected to install for this repository, but .pre-commit-config.yaml does not seem to exist." >&2 ; exit 1)
42
+ $(PYTHON3 ) -m venv \
43
+ .venv-pre-commit
44
+ source .venv-pre-commit/bin/activate \
45
+ && pip install \
46
+ --upgrade \
47
+ pip \
48
+ setuptools \
49
+ wheel
50
+ source .venv-pre-commit/bin/activate \
51
+ && pip install \
52
+ pre-commit
53
+ source .venv-pre-commit/bin/activate \
54
+ && pre-commit install
55
+ mkdir -p \
56
+ .venv-pre-commit/var
57
+ touch $@
58
+
36
59
check : \
37
- .git_submodule_init.done.log
60
+ .git_submodule_init.done.log \
61
+ .venv-pre-commit/var/.pre-commit-built.log
38
62
$(MAKE) \
39
63
--directory tests \
40
64
check
@@ -60,7 +84,8 @@ distclean: \
60
84
distclean
61
85
62
86
download : \
63
- .git_submodule_init.done.log
87
+ .git_submodule_init.done.log \
88
+ .venv-pre-commit/var/.pre-commit-built.log
64
89
$(MAKE) \
65
90
--directory tests \
66
91
download
Original file line number Diff line number Diff line change @@ -25,3 +25,14 @@ python_requires = >=3.8
25
25
[options.entry_points]
26
26
console_scripts =
27
27
case_exiftool = case_exiftool:main
28
+
29
+ [flake8]
30
+ # https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#flake8
31
+ extend-ignore =
32
+ E203
33
+ E302
34
+ E501
35
+
36
+ [isort]
37
+ # https://pycqa.github.io/isort/docs/configuration/black_compatibility.html
38
+ profile = black
You can’t perform that action at this time.
0 commit comments