1
1
mirror of https://github.com/anoma/juvix.git synced 2024-11-24 00:35:43 +03:00

[ Makefile ] added "prepare-push" to call hlint, ormolu, and check line witdh.

This commit is contained in:
Jonathan Prieto-Cubides 2021-10-30 11:51:42 +02:00
parent 08e1e752de
commit 374e5a08ce
2 changed files with 21 additions and 5 deletions

View File

@ -51,5 +51,6 @@
# IGNORES # IGNORES
# -------------------------------------------------------------------------------- # --------------------------------------------------------------------------------
- ignore: {within: [MiniJuvix.Syntax.Core, MiniJuvix.Syntax.Eval]}
- ignore: {name: Use let, within: [Test.All]} - ignore: {name: Use let, within: [Test.All]}
- ignore: {name: Use String} - ignore: {name: Use String}

View File

@ -2,6 +2,9 @@ PWD=$(CURDIR)
PREFIX="$(PWD)/.stack-work/prefix" PREFIX="$(PWD)/.stack-work/prefix"
UNAME := $(shell uname) UNAME := $(shell uname)
AGDA_FILES := $(wildcard ./src/MiniJuvix/Syntax/*.agda)
GEN_HS := $(patsubst %.agda, %.hs, $(AGDA_FILES))
ifeq ($(UNAME), Darwin) ifeq ($(UNAME), Darwin)
THREADS := $(shell sysctl -n hw.logicalcpu) THREADS := $(shell sysctl -n hw.logicalcpu)
else ifeq ($(UNAME), Linux) else ifeq ($(UNAME), Linux)
@ -10,10 +13,13 @@ else
THREADS := $(shell echo %NUMBER_OF_PROCESSORS%) THREADS := $(shell echo %NUMBER_OF_PROCESSORS%)
endif endif
all:
make prepare-push
.PHONY : checklines .PHONY : checklines
checklines : checklines :
@grep '.\{81,\}' \ @grep '.\{81,\}' \
--exclude-dir=src/fix-whitespace \ --exclude=*.agda \
-l --recursive src; \ -l --recursive src; \
status=$$?; \ status=$$?; \
if [ $$status = 0 ] ; \ if [ $$status = 0 ] ; \
@ -34,14 +40,17 @@ cabal-build :
cabal build all cabal build all
.PHONY : gen .PHONY : gen
gen : gen :
agda2hs ./src/MiniJuvix/Syntax/Core.agda -o src -X UnicodeSyntax agda2hs ./src/MiniJuvix/Syntax/Core.agda -o src -XUnicodeSyntax -XStandaloneDeriving -XDerivingStrategies -XMultiParamTypeClasses
agda2hs ./src/MiniJuvix/Syntax/Eval.agda -o src -X UnicodeSyntax agda2hs ./src/MiniJuvix/Syntax/Eval.agda -o src -XUnicodeSyntax -XStandaloneDeriving -XDerivingStrategies -XMultiParamTypeClasses
.PHONY : stan .PHONY : stan
stan : stan :
stan check --include --filter-all --directory=src stan check --include --filter-all --directory=src
setup:
stack build --only-dependencies --jobs $(THREADS)
stack-build: stack-build:
stack build --fast --jobs $(THREADS) stack build --fast --jobs $(THREADS)
@ -56,4 +65,10 @@ clean:
stack clean stack clean
clean-full: 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