File tree Expand file tree Collapse file tree 1 file changed +28
-6
lines changed Expand file tree Collapse file tree 1 file changed +28
-6
lines changed Original file line number Diff line number Diff line change @@ -27,18 +27,40 @@ init: ## Set up git hooks and ignored revisions.
27
27
@git config core.hooksPath .githooks
28
28
# # TODO
29
29
30
+ # NOTE: Keep this in sync with `.github/workflows/format.yml`.
31
+ FORMAT_DIRS := \
32
+ bootstrap \
33
+ buildinfo-reference-generator \
34
+ Cabal \
35
+ Cabal-benchmarks \
36
+ Cabal-described \
37
+ Cabal-dev-scripts \
38
+ Cabal-hooks \
39
+ cabal-install \
40
+ cabal-install-solver \
41
+ Cabal-QuickCheck \
42
+ Cabal-syntax \
43
+ Cabal-tests \
44
+ Cabal-testsuite/src \
45
+ Cabal-testsuite/main \
46
+ Cabal-testsuite/static \
47
+ Cabal-tree-diff \
48
+ cabal-validate \
49
+ solver-benchmarks
50
+
51
+
30
52
.PHONY : style
31
- style : # # Run the code styler.
32
- @fourmolu -q -i Cabal Cabal-syntax cabal-install cabal-validate
53
+ style : # # Run the code styler
54
+ @fourmolu -q -i $( FORMAT_DIRS )
33
55
34
56
.PHONY : style-modified
35
- style-modified : # # Run the code styler on modified files.
36
- @git ls-files --modified Cabal Cabal-syntax cabal-install cabal-validate \
57
+ style-modified : # # Run the code styler on modified files
58
+ @git ls-files --modified $( FORMAT_DIRS ) \
37
59
| grep ' .hs$$' | xargs -P $(PROCS ) -I {} fourmolu -q -i {}
38
60
39
61
.PHONY : style-commit
40
- style-commit : # # Run the code styler on the previous commit.
41
- @git diff --name-only HEAD $(COMMIT ) Cabal Cabal-syntax cabal-install cabal-validate \
62
+ style-commit : # # Run the code styler on the previous commit
63
+ @git diff --name-only HEAD $(COMMIT ) -- $( FORMAT_DIRS ) \
42
64
| grep ' .hs$$' | xargs -P $(PROCS ) -I {} fourmolu -q -i {}
43
65
44
66
.PHONY : whitespace
You can’t perform that action at this time.
0 commit comments