mirror of
https://github.com/anoma/juvix.git
synced 2024-11-23 16:25:37 +03:00
[ Makefile ] added "prepare-push" to call hlint, ormolu, and check line witdh.
This commit is contained in:
parent
08e1e752de
commit
374e5a08ce
@ -51,5 +51,6 @@
|
||||
# IGNORES
|
||||
# --------------------------------------------------------------------------------
|
||||
|
||||
- ignore: {within: [MiniJuvix.Syntax.Core, MiniJuvix.Syntax.Eval]}
|
||||
- ignore: {name: Use let, within: [Test.All]}
|
||||
- ignore: {name: Use String}
|
25
Makefile
25
Makefile
@ -2,6 +2,9 @@ PWD=$(CURDIR)
|
||||
PREFIX="$(PWD)/.stack-work/prefix"
|
||||
UNAME := $(shell uname)
|
||||
|
||||
AGDA_FILES := $(wildcard ./src/MiniJuvix/Syntax/*.agda)
|
||||
GEN_HS := $(patsubst %.agda, %.hs, $(AGDA_FILES))
|
||||
|
||||
ifeq ($(UNAME), Darwin)
|
||||
THREADS := $(shell sysctl -n hw.logicalcpu)
|
||||
else ifeq ($(UNAME), Linux)
|
||||
@ -10,10 +13,13 @@ else
|
||||
THREADS := $(shell echo %NUMBER_OF_PROCESSORS%)
|
||||
endif
|
||||
|
||||
all:
|
||||
make prepare-push
|
||||
|
||||
.PHONY : checklines
|
||||
checklines :
|
||||
@grep '.\{81,\}' \
|
||||
--exclude-dir=src/fix-whitespace \
|
||||
--exclude=*.agda \
|
||||
-l --recursive src; \
|
||||
status=$$?; \
|
||||
if [ $$status = 0 ] ; \
|
||||
@ -34,14 +40,17 @@ cabal-build :
|
||||
cabal build all
|
||||
|
||||
.PHONY : gen
|
||||
gen :
|
||||
agda2hs ./src/MiniJuvix/Syntax/Core.agda -o src -X UnicodeSyntax
|
||||
agda2hs ./src/MiniJuvix/Syntax/Eval.agda -o src -X UnicodeSyntax
|
||||
gen :
|
||||
agda2hs ./src/MiniJuvix/Syntax/Core.agda -o src -XUnicodeSyntax -XStandaloneDeriving -XDerivingStrategies -XMultiParamTypeClasses
|
||||
agda2hs ./src/MiniJuvix/Syntax/Eval.agda -o src -XUnicodeSyntax -XStandaloneDeriving -XDerivingStrategies -XMultiParamTypeClasses
|
||||
|
||||
.PHONY : stan
|
||||
stan :
|
||||
stan check --include --filter-all --directory=src
|
||||
|
||||
setup:
|
||||
stack build --only-dependencies --jobs $(THREADS)
|
||||
|
||||
stack-build:
|
||||
stack build --fast --jobs $(THREADS)
|
||||
|
||||
@ -56,4 +65,10 @@ clean:
|
||||
stack clean
|
||||
|
||||
clean-full:
|
||||
stack clean --full
|
||||
stack clean --full
|
||||
|
||||
format:
|
||||
find ./src/ -name "*.hs" -exec ormolu --mode inplace {} --ghc-opt -XStandaloneDeriving --ghc-opt -XUnicodeSyntax --ghc-opt -XDerivingStrategies --ghc-opt -XMultiParamTypeClasses \;
|
||||
|
||||
prepare-push:
|
||||
make checklines && make hlint && make format
|
||||
|
Loading…
Reference in New Issue
Block a user