-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
40 lines (33 loc) · 970 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.PHONY: build test format check-format
ps-sources := $(shell fd --no-ignore-parent -epurs)
nix-sources := $(shell fd --no-ignore-parent -enix --exclude='spago*')
js-sources := $(shell fd --no-ignore-parent -ejs -ecjs)
build:
@spago build
@spago2nix generate
test:
spago test
.ONESHELL:
check-explicit-exports:
@if grep -rn '(\.\.)' ${ps-sources}; then
echo "Use explicit imports/exports ^"
exit 1
else
echo "All imports/exports are explicit"
fi
check-format: check-explicit-exports
@purs-tidy check ${ps-sources}
@nixpkgs-fmt --check ${nix-sources}
@eslint --quiet ${js-sources} --parser-options 'sourceType: module'
format:
@doctoc CHANGELOG.md --github --notitle
@purs-tidy format-in-place ${ps-sources}
@nixpkgs-fmt ${nix-sources}
@make check-format
# Run Nix CI locally
run-ci-actions:
nix build -L .#checks.x86_64-linux.formatting-check
nix build -L .#checks.x86_64-linux.tests