File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -155,8 +155,15 @@ Code Style
155155---------------
156156
157157We use automated formatting with Fourmolu to enforce a unified style across the code bases. It is checked in the CI process.
158- After installing Fourmolu 0.12, you can automatically format the code bases with `make style` at the top level of the project.
159- You can also use `make style-modified` to only format modified files.
158+ After installing Fourmolu 0.12, there are some makefile targets to help formatting
159+ the code base.
160+
161+
162+ * `make style` - Format the `Cabal`, `Cabal-syntax` and `cabal-install` directories.
163+ * `make style-modified` - Format files modified in the current tree.
164+ * `make style-commit COMMIT=<ref>` - Format files modified between HEAD and the given reference.
165+
166+
160167
161168Other Conventions
162169-----------------
Original file line number Diff line number Diff line change @@ -25,6 +25,10 @@ style-modified: ## Run the code styler on modified files
2525 @git ls-files --modified Cabal Cabal-syntax cabal-install \
2626 | grep ' .hs$$' | xargs -P $(PROCS ) -I {} fourmolu -q -i {}
2727
28+ style-commit : # # Run the code styler on the previous commit
29+ @git diff --name-only HEAD $(COMMIT ) Cabal Cabal-syntax cabal-install \
30+ | grep ' .hs$$' | xargs -P $(PROCS ) -I {} fourmolu -q -i {}
31+
2832# source generation: SPDX
2933
3034SPDX_LICENSE_HS: =Cabal-syntax/src/Distribution/SPDX/LicenseId.hs
You can’t perform that action at this time.
0 commit comments