;just: fmt

This commit is contained in:
Simon Michael 2023-12-15 18:35:03 -10:00
parent 78aea61b60
commit da5c507383

180
Justfile
View File

@ -10,6 +10,7 @@
@help: @help:
just -lu just -lu
# This and all other just invocations assume you are in this justfile's directory, # This and all other just invocations assume you are in this justfile's directory,
# otherwise we must write --justfile {{ justfile() }} or {{ just }} everywhere. # otherwise we must write --justfile {{ justfile() }} or {{ just }} everywhere.
@ -338,16 +339,17 @@ BUILDING:
# # build "bin/hledgercov" for coverage reports (with ghc) # # build "bin/hledgercov" for coverage reports (with ghc)
# hledgercov: # hledgercov:
# {{ STACK }} ghc {{ MAIN }} -fhpc -o bin/hledgercov -outputdir .hledgercovobjs {{ BUILDFLAGS }} # {{ STACK }} ghc {{ MAIN }} -fhpc -o bin/hledgercov -outputdir .hledgercovobjs {{ BUILDFLAGS }}
# ** testing # ** testing
TESTING: TESTING:
# run tests that are reasonably quick (files, unit, functional) and benchmarks # run tests that are reasonably quick (files, unit, functional) and benchmarks
test: filestest functest #bench test: filestest functest
#bench
# For quieter tests add --silent. It may hide troubleshooting info. # For quieter tests add --silent. It may hide troubleshooting info.
# For very verbose tests add --verbosity=debug. It seems hard to get something in between. # For very verbose tests add --verbosity=debug. It seems hard to get something in between.
STACKTEST := STACK + ' test --fast' STACKTEST := STACK + ' test --fast'
# # When doing build testing, save a little time and output noise by not # # When doing build testing, save a little time and output noise by not
@ -358,58 +360,50 @@ STACKTEST := STACK + ' test --fast'
@filestest: @filestest:
tools/checkembeddedfiles tools/checkembeddedfiles
# # stack build --dry-run all hledger packages ensuring an install plan with default snapshot) # # stack build --dry-run all hledger packages ensuring an install plan with default snapshot)
# buildplantest: # buildplantest:
# buildplantest-stack.yaml # buildplantest-stack.yaml
# # stack build --dry-run all hledger packages ensuring an install plan with each ghc version/stackage snapshot
# # stack build --dry-run all hledger packages ensuring an install plan with each ghc version/stackage snapshot
# buildplantest-all: # buildplantest-all:
# for F in stack*.yaml; do make --no-print-directory buildplantest-$F; done # for F in stack*.yaml; do make --no-print-directory buildplantest-$F; done
# # stack build --dry-run all hledger packages ensuring an install plan with the given stack yaml file; eg make buildplantest-stack8.2.yaml
# # stack build --dry-run all hledger packages ensuring an install plan with the given stack yaml file; eg make buildplantest-stack8.2.yaml
# buildplantest-%: # buildplantest-%:
# {{ STACK }} build --dry-run --test --bench --stack-yaml=$* # {{ STACK }} build --dry-run --test --bench --stack-yaml=$*
# # force-rebuild all hledger packages/modules quickly ensuring no warnings with default snapshot)
# # force-rebuild all hledger packages/modules quickly ensuring no warnings with default snapshot)
# buildtest: # buildtest:
# buildtest-stack.yaml # buildtest-stack.yaml
# # force-rebuild all hledger packages/modules quickly ensuring no warnings with each ghc version/stackage snapshot
# # force-rebuild all hledger packages/modules quickly ensuring no warnings with each ghc version/stackage snapshot
# buildtest-all: # buildtest-all:
# for F in stack*.yaml; do make --no-print-directory buildtest-$F; done # for F in stack*.yaml; do make --no-print-directory buildtest-$F; done
# # force-rebuild all hledger packages/modules quickly ensuring no warnings with the given stack yaml file; eg make buildtest-stack8.2.yaml
# # force-rebuild all hledger packages/modules quickly ensuring no warnings with the given stack yaml file; eg make buildtest-stack8.2.yaml
# buildtest-%: # buildtest-%:
# {{ STACK }} build --test --bench {{ SKIPTESTSBENCHS }} --fast --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror --stack-yaml=$* # {{ STACK }} build --test --bench {{ SKIPTESTSBENCHS }} --fast --force-dirty --ghc-options=-fforce-recomp --ghc-options=-Werror --stack-yaml=$*
# # build any outdated hledger packages/modules quickly ensuring no warnings with default snapshot. Wont detect warnings in up-to-date modules.)
# # build any outdated hledger packages/modules quickly ensuring no warnings with default snapshot. Wont detect warnings in up-to-date modules.)
# incr-buildtest: # incr-buildtest:
# incr-buildtest-stack.yaml # incr-buildtest-stack.yaml
# # build any outdated hledger packages/modules quickly ensuring no warnings with each ghc version/stackage snapshot. Wont detect warnings in up-to-date modules.
# # build any outdated hledger packages/modules quickly ensuring no warnings with each ghc version/stackage snapshot. Wont detect warnings in up-to-date modules.
# incr-buildtest-all: # incr-buildtest-all:
# for F in stack*.yaml; do make --no-print-directory incr-buildtest-$F; done # for F in stack*.yaml; do make --no-print-directory incr-buildtest-$F; done
# # build any outdated hledger packages/modules quickly ensuring no warnings with the stack yaml file; eg make buildtest-stack8.2.yaml. Wont detect warnings in up-to-date modules.
# # build any outdated hledger packages/modules quickly ensuring no warnings with the stack yaml file; eg make buildtest-stack8.2.yaml. Wont detect warnings in up-to-date modules.
# incr-buildtest-%: # incr-buildtest-%:
# {{ STACK }} build --test --bench {{ SKIPTESTSBENCHS }} --fast --ghc-options=-Werror --stack-yaml=$* # {{ STACK }} build --test --bench {{ SKIPTESTSBENCHS }} --fast --ghc-options=-Werror --stack-yaml=$*
# # do a stack clean --full with all ghc versions for paranoia/troubleshooting
# # do a stack clean --full with all ghc versions for paranoia/troubleshooting
# stack-clean-all: # stack-clean-all:
# for F in stack*.yaml; do {{ STACK }} clean --full --stack-yaml=$F; done # for F in stack*.yaml; do {{ STACK }} clean --full --stack-yaml=$F; done
# run all test suites in the hledger packages # run all test suites in the hledger packages
@pkgtest: @pkgtest:
({{ STACKTEST }} && echo $@ PASSED) || (echo $@ FAILED; false) ({{ STACKTEST }} && echo $@ PASSED) || (echo $@ FAILED; false)
# doctest with ghc 8.4 on mac requires a workaround, see hledger-lib/package.yaml. # doctest with ghc 8.4 on mac requires a workaround, see hledger-lib/package.yaml.
# Or, could run it with ghc 8.2: # Or, could run it with ghc 8.2:
# @({{ STACKTEST }} --stack-yaml stack8.2.yaml hledger-lib:test:doctest && echo $@ PASSED) || (echo $@ FAILED; false) # @({{ STACKTEST }} --stack-yaml stack8.2.yaml hledger-lib:test:doctest && echo $@ PASSED) || (echo $@ FAILED; false)
# run the doctests in hledger-lib module/function docs
# run the doctests in hledger-lib module/function docs
@doctest: @doctest:
({{ STACKTEST }} hledger-lib:test:doctest && echo $@ PASSED) || (echo $@ FAILED; false) ({{ STACKTEST }} hledger-lib:test:doctest && echo $@ PASSED) || (echo $@ FAILED; false)
# # run the unit tests in hledger-lib # # run the unit tests in hledger-lib
# unittest: # unittest:
# @({{ STACKTEST }} hledger-lib:test:unittest && echo $@ PASSED) || (echo $@ FAILED; false) # @({{ STACKTEST }} hledger-lib:test:unittest && echo $@ PASSED) || (echo $@ FAILED; false)
@ -418,12 +412,13 @@ STACKTEST := STACK + ' test --fast'
({{ STACK }} exec hledger test && echo $@ PASSED) || (echo $@ FAILED; false) ({{ STACK }} exec hledger test && echo $@ PASSED) || (echo $@ FAILED; false)
SHELLTEST := 'COLUMNS=80 ' + STACK + ' exec -- shelltest --execdir --threads=64 --exclude=/_' SHELLTEST := 'COLUMNS=80 ' + STACK + ' exec -- shelltest --execdir --threads=64 --exclude=/_'
# --hide-successes # --hide-successes
# build hledger quickly and run functional tests, or just the ones matching PAT. (Run mktestaddons first.) # build hledger quickly and run functional tests, or just the ones matching PAT. (Run mktestaddons first.)
@functest *PAT: @functest *PAT:
{{ STACK }} build --fast hledger {{ STACK }} build --fast hledger
({{ SHELLTEST }} {{ if PAT == '' { '' } else { '-i "'+PAT+'"' } }} \ ({{ SHELLTEST }} {{ if PAT == '' { '' } else { '-i "' + PAT + '"' } }} \
hledger/test/ bin/ \ hledger/test/ bin/ \
-x ledger-compat/ledger-baseline -x ledger-compat/ledger-regress -x ledger-compat/ledger-extra \ -x ledger-compat/ledger-baseline -x ledger-compat/ledger-regress -x ledger-compat/ledger-extra \
&& echo $@ PASSED) || (echo $@ FAILED; false) && echo $@ PASSED) || (echo $@ FAILED; false)
@ -444,22 +439,17 @@ ADDONEXTS := 'pl py rb sh hs lhs rkt exe com bat'
# generate a hlint report # generate a hlint report
# hlinttest hlint: # hlinttest hlint:
# hlint --hint=hlint --report=hlint.html {{ SOURCEFILES }} # hlint --hint=hlint --report=hlint.html {{ SOURCEFILES }}
# # run haddock to make sure it can generate docs without dying
# # run haddock to make sure it can generate docs without dying
# @haddocktest: # @haddocktest:
# (make --quiet haddock && echo $@ PASSED) || (echo $@ FAILED; false) # (make --quiet haddock && echo $@ PASSED) || (echo $@ FAILED; false)
# # run cabal check to test cabal file syntax
# # run cabal check to test cabal file syntax
# cabalfiletest: # cabalfiletest:
# @(make --no-print-directory cabalcheck && echo $@ PASSED) || (echo $@ FAILED; false) # @(make --no-print-directory cabalcheck && echo $@ PASSED) || (echo $@ FAILED; false)
# test-stack%yaml: # test-stack%yaml:
# {{ STACK }} --stack-yaml stack$*yaml clean # {{ STACK }} --stack-yaml stack$*yaml clean
# {{ STACK }} --stack-yaml stack$*yaml build --ghc-options="{{ WARNINGS }} -Werror" --test --bench --haddock --no-haddock-deps # {{ STACK }} --stack-yaml stack$*yaml build --ghc-options="{{ WARNINGS }} -Werror" --test --bench --haddock --no-haddock-deps
# committest: hlinttest unittest doctest functest haddocktest buildtest quickcabaltest \ # committest: hlinttest unittest doctest functest haddocktest buildtest quickcabaltest \
# #
# releasetest: Clean unittest functest fullcabaltest haddocktest #buildtest doctest \ # releasetest: Clean unittest functest fullcabaltest haddocktest #buildtest doctest \
# {{ call def-help,releasetest,pre-release tests }} # {{ call def-help,releasetest,pre-release tests }}
@ -495,77 +485,53 @@ mksamplejournals:
# # examples/ascii.journal \ # # examples/ascii.journal \
# # examples/chinese.journal \ # # examples/chinese.journal \
# # examples/mixed.journal \ # # examples/mixed.journal \
# examples/sample.journal: # examples/sample.journal:
# true # XXX should probably regenerate this # true # XXX should probably regenerate this
# examples/10x10x10.journal: tools/generatejournal # examples/10x10x10.journal: tools/generatejournal
# tools/generatejournal 10 10 10 >$@ # tools/generatejournal 10 10 10 >$@
# examples/100x100x10.journal: tools/generatejournal # examples/100x100x10.journal: tools/generatejournal
# tools/generatejournal 100 100 10 >$@ # tools/generatejournal 100 100 10 >$@
# examples/1000x1000x10.journal: tools/generatejournal # examples/1000x1000x10.journal: tools/generatejournal
# tools/generatejournal 1000 1000 10 >$@ # tools/generatejournal 1000 1000 10 >$@
# examples/1000x10000x10.journal: tools/generatejournal # examples/1000x10000x10.journal: tools/generatejournal
# tools/generatejournal 1000 10000 10 >$@ # tools/generatejournal 1000 10000 10 >$@
# examples/2000x1000x10.journal: tools/generatejournal # examples/2000x1000x10.journal: tools/generatejournal
# tools/generatejournal 2000 1000 10 >$@ # tools/generatejournal 2000 1000 10 >$@
# examples/3000x1000x10.journal: tools/generatejournal # examples/3000x1000x10.journal: tools/generatejournal
# tools/generatejournal 3000 1000 10 >$@ # tools/generatejournal 3000 1000 10 >$@
# examples/4000x1000x10.journal: tools/generatejournal # examples/4000x1000x10.journal: tools/generatejournal
# tools/generatejournal 4000 1000 10 >$@ # tools/generatejournal 4000 1000 10 >$@
# examples/5000x1000x10.journal: tools/generatejournal # examples/5000x1000x10.journal: tools/generatejournal
# tools/generatejournal 5000 1000 10 >$@ # tools/generatejournal 5000 1000 10 >$@
# examples/6000x1000x10.journal: tools/generatejournal # examples/6000x1000x10.journal: tools/generatejournal
# tools/generatejournal 6000 1000 10 >$@ # tools/generatejournal 6000 1000 10 >$@
# examples/7000x1000x10.journal: tools/generatejournal # examples/7000x1000x10.journal: tools/generatejournal
# tools/generatejournal 7000 1000 10 >$@ # tools/generatejournal 7000 1000 10 >$@
# examples/8000x1000x10.journal: tools/generatejournal # examples/8000x1000x10.journal: tools/generatejournal
# tools/generatejournal 8000 1000 10 >$@ # tools/generatejournal 8000 1000 10 >$@
# examples/9000x1000x10.journal: tools/generatejournal # examples/9000x1000x10.journal: tools/generatejournal
# tools/generatejournal 9000 1000 10 >$@ # tools/generatejournal 9000 1000 10 >$@
# examples/10000x1000x10.journal: tools/generatejournal # examples/10000x1000x10.journal: tools/generatejournal
# tools/generatejournal 10000 1000 10 >$@ # tools/generatejournal 10000 1000 10 >$@
# examples/10000x10000x10.journal: tools/generatejournal # examples/10000x10000x10.journal: tools/generatejournal
# tools/generatejournal 10000 10000 10 >$@ # tools/generatejournal 10000 10000 10 >$@
# examples/100000x1000x10.journal: tools/generatejournal # examples/100000x1000x10.journal: tools/generatejournal
# tools/generatejournal 100000 1000 10 >$@ # tools/generatejournal 100000 1000 10 >$@
# examples/1000000x1000x10.journal: tools/generatejournal # examples/1000000x1000x10.journal: tools/generatejournal
# tools/generatejournal 1000000 1000 10 >$@ # tools/generatejournal 1000000 1000 10 >$@
# examples/ascii.journal: tools/generatejournal # examples/ascii.journal: tools/generatejournal
# tools/generatejournal 3 5 5 >$@ # tools/generatejournal 3 5 5 >$@
# examples/chinese.journal: tools/generatejournal # examples/chinese.journal: tools/generatejournal
# tools/generatejournal 3 5 5 --chinese >$@ # tools/generatejournal 3 5 5 --chinese >$@
# examples/mixed.journal: tools/generatejournal # examples/mixed.journal: tools/generatejournal
# tools/generatejournal 3 5 5 --mixed >$@ # tools/generatejournal 3 5 5 --mixed >$@
# # hledger executables to bench test, can be overridden by env var,
# # hledger executables to bench test, can be overridden by env var,
# # eg: BENCHEXES=ledger,hledger-1.18,hledger make bench # # eg: BENCHEXES=ledger,hledger-1.18,hledger make bench
# BENCHEXES ?= hledger # BENCHEXES ?= hledger
# bench: quickbench # bench: quickbench
# quickbench: samplejournals bench.sh $(call def-help,quickbench, benchmark commands in bench.sh with quickbench and $(BENCHEXES)) # quickbench: samplejournals bench.sh $(call def-help,quickbench, benchmark commands in bench.sh with quickbench and $(BENCHEXES))
# @echo; echo "run quick performance benchmarks in bench.sh (approximate, can be skewed):" # @echo; echo "run quick performance benchmarks in bench.sh (approximate, can be skewed):"
# @which quickbench >/dev/null && quickbench -w $(BENCHEXES) || echo "quickbench not installed (see bench.sh), skipping" # @which quickbench >/dev/null && quickbench -w $(BENCHEXES) || echo "quickbench not installed (see bench.sh), skipping"
# # bench: samplejournals tests/bench.tests tools/simplebench \ # # bench: samplejournals tests/bench.tests tools/simplebench \
# # $(call def-help,bench,\ # # $(call def-help,bench,\
# # run simple performance benchmarks and archive results\ # # run simple performance benchmarks and archive results\
@ -574,22 +540,18 @@ mksamplejournals:
# # tools/simplebench -v -ftests/bench.tests $(BENCHEXES) | tee doc/profs/$(TIME).bench # # tools/simplebench -v -ftests/bench.tests $(BENCHEXES) | tee doc/profs/$(TIME).bench
# # @rm -f benchresults.* # # @rm -f benchresults.*
# # @(cd doc/profs; rm -f latest.bench; ln -s $(TIME).bench latest.bench) # # @(cd doc/profs; rm -f latest.bench; ln -s $(TIME).bench latest.bench)
# # criterionbench: samplejournals tools/criterionbench \ # # criterionbench: samplejournals tools/criterionbench \
# # $(call def-help,criterionbench,\ # # $(call def-help,criterionbench,\
# # run criterion benchmark tests and save graphical results\ # # run criterion benchmark tests and save graphical results\
# # ) # # )
# # tools/criterionbench -t png -k png # # tools/criterionbench -t png -k png
# # progressionbench: samplejournals tools/progressionbench \ # # progressionbench: samplejournals tools/progressionbench \
# # $(call def-help,progressionbench,\ # # $(call def-help,progressionbench,\
# # run progression benchmark tests and save graphical results\ # # run progression benchmark tests and save graphical results\
# # ) # # )
# # tools/progressionbench -- -t png -k png # # tools/progressionbench -- -t png -k png
# throughput: throughput-hledger \ # throughput: throughput-hledger \
# $(call def-help,throughput, show throughput at various data sizes with the default hledger executable ) # $(call def-help,throughput, show throughput at various data sizes with the default hledger executable )
# throughput-%: samplejournals \ # throughput-%: samplejournals \
# $(call def-help,throughput-HLEDGEREXE, show throughput at various data sizes with the given hledger executable ) # $(call def-help,throughput-HLEDGEREXE, show throughput at various data sizes with the given hledger executable )
# @echo date: `date` # @echo date: `date`
@ -600,12 +562,10 @@ mksamplejournals:
# printf "%6d txns: " $$n; $* stats -f examples/$${n}x1000x10.journal | tail -1; \ # printf "%6d txns: " $$n; $* stats -f examples/$${n}x1000x10.journal | tail -1; \
# done # done
# @date # @date
# throughput-dev: samplejournals \ # throughput-dev: samplejournals \
# $(call def-help,throughput-dev, show throughput at various data sizes with the latest hledger dev build (optimised or not) ) # $(call def-help,throughput-dev, show throughput at various data sizes with the latest hledger dev build (optimised or not) )
# @stack build hledger # @stack build hledger
# @stack exec -- make -s throughput # @stack exec -- make -s throughput
# # prof: samplejournals \ # # prof: samplejournals \
# # $(call def-help,prof,\ # # $(call def-help,prof,\
# # generate and archive an execution profile\ # # generate and archive an execution profile\
@ -614,13 +574,11 @@ mksamplejournals:
# # -$(PROFCMD) +RTS $(PROFRTSFLAGS) -RTS # # -$(PROFCMD) +RTS $(PROFRTSFLAGS) -RTS
# # mv hledgerprof.prof doc/profs/$(TIME).prof # # mv hledgerprof.prof doc/profs/$(TIME).prof
# # (cd doc/profs; rm -f latest*.prof; ln -s $(TIME).prof latest.prof) # # (cd doc/profs; rm -f latest*.prof; ln -s $(TIME).prof latest.prof)
# # viewprof: prof \ # # viewprof: prof \
# # $(call def-help,viewprof,\ # # $(call def-help,viewprof,\
# # generate, archive, simplify and display an execution profile\ # # generate, archive, simplify and display an execution profile\
# # ) # # )
# # tools/simplifyprof.hs doc/profs/latest.prof # # tools/simplifyprof.hs doc/profs/latest.prof
# quickprof-%: hledgerprof samplejournals \ # quickprof-%: hledgerprof samplejournals \
# $(call def-help,quickprof-"CMD", run some command against a standard sample journal and display the execution profile ) # $(call def-help,quickprof-"CMD", run some command against a standard sample journal and display the execution profile )
# $(STACK) exec --profile -- hledger +RTS $(PROFRTSFLAGS) -RTS $* -f examples/1000x1000x10.journal >/dev/null # $(STACK) exec --profile -- hledger +RTS $(PROFRTSFLAGS) -RTS $* -f examples/1000x1000x10.journal >/dev/null
@ -633,7 +591,6 @@ mksamplejournals:
# @echo ... # @echo ...
# @echo # @echo
# @echo "See hledger.prof, hledger.profiterole.txt, hledger.profiterole.html for more." # @echo "See hledger.prof, hledger.profiterole.txt, hledger.profiterole.html for more."
# # heap: samplejournals \ # # heap: samplejournals \
# # $(call def-help,heap,\ # # $(call def-help,heap,\
# # generate and archive a graphical heap profile\ # # generate and archive a graphical heap profile\
@ -643,27 +600,23 @@ mksamplejournals:
# # mv hledgerprof.hp doc/profs/$(TIME).hp # # mv hledgerprof.hp doc/profs/$(TIME).hp
# # (cd doc/profs; rm -f latest.hp; ln -s $(TIME).hp latest.hp; \ # # (cd doc/profs; rm -f latest.hp; ln -s $(TIME).hp latest.hp; \
# # hp2ps $(TIME).hp; rm -f latest.ps; ln -s $(TIME).ps latest.ps; rm -f *.aux) # # hp2ps $(TIME).hp; rm -f latest.ps; ln -s $(TIME).ps latest.ps; rm -f *.aux)
# # viewheap: heap \ # # viewheap: heap \
# # $(call def-help,viewheap,\ # # $(call def-help,viewheap,\
# # \ # # \
# # ) # # )
# # $(VIEWPS) doc/profs/latest.ps # # $(VIEWPS) doc/profs/latest.ps
# quickheap-%: hledgerprof samplejournals \ # quickheap-%: hledgerprof samplejournals \
# $(call def-help,quickheap-"CMD", run some command against a sample journal and display the heap profile ) # $(call def-help,quickheap-"CMD", run some command against a sample journal and display the heap profile )
# $(STACK) exec -- hledgerprof +RTS -hc -RTS $* -f examples/10000x1000x10.journal >/dev/null # $(STACK) exec -- hledgerprof +RTS -hc -RTS $* -f examples/10000x1000x10.journal >/dev/null
# hp2ps hledgerprof.hp # hp2ps hledgerprof.hp
# @echo generated hledgerprof.ps # @echo generated hledgerprof.ps
# $(VIEWPS) hledgerprof.ps # $(VIEWPS) hledgerprof.ps
# # quickcoverage: hledgercov \ # # quickcoverage: hledgercov \
# # $(call def-help,quickcoverage,\ # # $(call def-help,quickcoverage,\
# # display a code coverage text report from running hledger COVCMD\ # # display a code coverage text report from running hledger COVCMD\
# # ) # # )
# # @echo "Generating code coverage text report for hledger command: $(COVCMD)" # # @echo "Generating code coverage text report for hledger command: $(COVCMD)"
# # tools/runhledgercov "report" $(COVCMD) # # tools/runhledgercov "report" $(COVCMD)
# # coverage: samplejournals hledgercov \ # # coverage: samplejournals hledgercov \
# # $(call def-help,coverage,\ # # $(call def-help,coverage,\
# # generate a code coverage html report from running hledger COVCMD\ # # generate a code coverage html report from running hledger COVCMD\
@ -671,83 +624,65 @@ mksamplejournals:
# # @echo "Generating code coverage html report for hledger command: $(COVCMD)" # # @echo "Generating code coverage html report for hledger command: $(COVCMD)"
# # tools/runhledgercov "markup --destdir=doc/profs/coverage" $(COVCMD) # # tools/runhledgercov "markup --destdir=doc/profs/coverage" $(COVCMD)
# # cd doc/profs/coverage; rm -f index.html; ln -s hpc_index.html index.html # # cd doc/profs/coverage; rm -f index.html; ln -s hpc_index.html index.html
# # viewcoverage: \ # # viewcoverage: \
# # $(call def-help,viewcoverage,\ # # $(call def-help,viewcoverage,\
# # view the last html code coverage report\ # # view the last html code coverage report\
# # ) # # )
# # $(VIEWHTML) doc/profs/coverage/index.html # # $(VIEWHTML) doc/profs/coverage/index.html
# ############################################################################### # ###############################################################################
# $(call def-help-subheading,DOCUMENTATION: (see also Shake.hs)) # $(call def-help-subheading,DOCUMENTATION: (see also Shake.hs))
# # http://www.haskell.org/haddock/doc/html/invoking.html # # http://www.haskell.org/haddock/doc/html/invoking.html
# STACKHADDOCK=time $(STACK) --verbosity=error haddock --fast --no-keep-going \ # STACKHADDOCK=time $(STACK) --verbosity=error haddock --fast --no-keep-going \
# --only-locals --no-haddock-deps --no-haddock-hyperlink-source \ # --only-locals --no-haddock-deps --no-haddock-hyperlink-source \
# --haddock-arguments="--no-warnings" # --haddock-arguments="--no-warnings"
# # -ghc-options='-optP-P' # workaround for http://trac.haskell.org/haddock/ticket/284 # # -ghc-options='-optP-P' # workaround for http://trac.haskell.org/haddock/ticket/284
# # uncomment to run haddock on fewer packages, saving time # # uncomment to run haddock on fewer packages, saving time
# #HADDOCKPKGS=hledger-lib # #HADDOCKPKGS=hledger-lib
# releasediag: \ # releasediag: \
# $(call def-help,releasediag, optimise and commit RELEASING value map diagram ) # $(call def-help,releasediag, optimise and commit RELEASING value map diagram )
# pngquant doc/HledgerReleaseValueMap.png -f -o doc/HledgerReleaseValueMap.png && git add doc/HledgerReleaseValueMap.png && git commit -m ';doc: RELEASING: update value map' -- doc/HledgerReleaseValueMap.png # pngquant doc/HledgerReleaseValueMap.png -f -o doc/HledgerReleaseValueMap.png && git add doc/HledgerReleaseValueMap.png && git commit -m ';doc: RELEASING: update value map' -- doc/HledgerReleaseValueMap.png
# # Renders all hledger packages. Run make haddock-open to open contents page. # # Renders all hledger packages. Run make haddock-open to open contents page.
# haddock: \ # haddock: \
# $(call def-help,haddock, regenerate haddock docs for the hledger packages and open them ) # $(call def-help,haddock, regenerate haddock docs for the hledger packages and open them )
# $(STACKHADDOCK) $(HADDOCKPKGS) && make -s haddock-open # --open shows all deps and packages # $(STACKHADDOCK) $(HADDOCKPKGS) && make -s haddock-open # --open shows all deps and packages
# # Rerenders all hledger packages. Run make haddock-open to open contents page. # # Rerenders all hledger packages. Run make haddock-open to open contents page.
# haddock-watch1: \ # haddock-watch1: \
# $(call def-help,haddock-watch, regenerate haddock docs when files change ) # $(call def-help,haddock-watch, regenerate haddock docs when files change )
# $(STACKHADDOCK) $(HADDOCK_PKGS) --file-watch --exec='echo done' # $(STACKHADDOCK) $(HADDOCK_PKGS) --file-watch --exec='echo done'
# # Rerenders hledger-lib modules, opens hledger-lib contents page. # # Rerenders hledger-lib modules, opens hledger-lib contents page.
# haddock-watch2: \ # haddock-watch2: \
# $(call def-help,haddock-watch2, regenerate hledger-lib haddock docs when files change ) # $(call def-help,haddock-watch2, regenerate hledger-lib haddock docs when files change )
# watchexec -r -e yaml,cabal,hs --print-events -- \ # watchexec -r -e yaml,cabal,hs --print-events -- \
# $(STACKHADDOCK) --verbosity=info $(HADDOCK_PKGS) --exec="'echo done'" hledger-lib --open # $(STACKHADDOCK) --verbosity=info $(HADDOCK_PKGS) --exec="'echo done'" hledger-lib --open
# # Rerenders/reopens the Hledger module, without submodules. (Fastest) # # Rerenders/reopens the Hledger module, without submodules. (Fastest)
# haddock-watch: \ # haddock-watch: \
# $(call def-help,haddock-watch3, quickly regenerate & reload Hledger.hs haddock when files change ) # $(call def-help,haddock-watch3, quickly regenerate & reload Hledger.hs haddock when files change )
# watchexec -r -e yaml,cabal,hs --print-events --shell=none -- bash -c 'mkdir -p tmp && rm -f tmp/Hledger.html && haddock -h -o tmp hledger-lib/Hledger.hs --no-warnings --no-print-missing-docs 2>&1 | grep -v "Could not find documentation" && open tmp/Hledger.html' # watchexec -r -e yaml,cabal,hs --print-events --shell=none -- bash -c 'mkdir -p tmp && rm -f tmp/Hledger.html && haddock -h -o tmp hledger-lib/Hledger.hs --no-warnings --no-print-missing-docs 2>&1 | grep -v "Could not find documentation" && open tmp/Hledger.html'
# haddock-open: \ # haddock-open: \
# $(call def-help,haddock-open, open the haddock packages contents page in a browser ) # $(call def-help,haddock-open, open the haddock packages contents page in a browser )
# $(BROWSE) `stack path --local-install-root`/doc/index.html # $(BROWSE) `stack path --local-install-root`/doc/index.html
# hoogle-setup: $(call def-help,hoogle-setup, install hoogle then build haddocks and a hoogle db for the project and all deps ) # hoogle-setup: $(call def-help,hoogle-setup, install hoogle then build haddocks and a hoogle db for the project and all deps )
# stack hoogle --rebuild # stack hoogle --rebuild
# HOOGLEBROWSER="/Applications/Firefox Dev.app/Contents/MacOS/firefox" # safari not supported # HOOGLEBROWSER="/Applications/Firefox Dev.app/Contents/MacOS/firefox" # safari not supported
# hoogle-serve: $(call def-help,hoogle-serve, run hoogle web app and open in browser after doing setup if needed ) # hoogle-serve: $(call def-help,hoogle-serve, run hoogle web app and open in browser after doing setup if needed )
# $(HOOGLEBROWSER) http://localhost:8080 & # $(HOOGLEBROWSER) http://localhost:8080 &
# stack --verbosity=warn hoogle --server # stack --verbosity=warn hoogle --server
# # sourcegraph: \ # # sourcegraph: \
# # $(call def-help,sourcegraph,\ # # $(call def-help,sourcegraph,\
# # \ # # \
# # ) # # )
# # for p in $(PACKAGES); do (cd $$p; SourceGraph $$p.cabal); done # # for p in $(PACKAGES); do (cd $$p; SourceGraph $$p.cabal); done
# manuals-watch: Shake \ # manuals-watch: Shake \
# $(call def-help,manuals-watch, rerender manuals when their source files change ) # $(call def-help,manuals-watch, rerender manuals when their source files change )
# ls $(DOCSOURCEFILES) | entr ./Shake -VV manuals # ls $(DOCSOURCEFILES) | entr ./Shake -VV manuals
# man-watch: man-watch-hledger \ # man-watch: man-watch-hledger \
# $(call def-help,man-watch, run man on the hledger man page when its source file changes ) # $(call def-help,man-watch, run man on the hledger man page when its source file changes )
# man-watch-%: Shake \ # man-watch-%: Shake \
# $(call def-help,man-watch-PROG, run man on the given man page when its source file changes. Eg make man-watch-hledger-web ) # $(call def-help,man-watch-PROG, run man on the given man page when its source file changes. Eg make man-watch-hledger-web )
# $(WATCHEXEC) -r -w $*/$*.m4.md './Shake $*/$*.1 && man $*/$*.1' # $(WATCHEXEC) -r -w $*/$*.m4.md './Shake $*/$*.1 && man $*/$*.1'
# shakehelp-watch: \ # shakehelp-watch: \
# $(call def-help,shakehelp-watch, rerender Shake.hs's help when it changes) # $(call def-help,shakehelp-watch, rerender Shake.hs's help when it changes)
# ls Shake.hs | entr -c ./Shake.hs # ls Shake.hs | entr -c ./Shake.hs
# # The following rule, for updating the website, gets called on hledger.org by: # # The following rule, for updating the website, gets called on hledger.org by:
# # 1. github-post-receive (github webhook handler), when something is pushed # # 1. github-post-receive (github webhook handler), when something is pushed
# # to the main or wiki repos on Github. Config: # # to the main or wiki repos on Github. Config:
@ -755,10 +690,7 @@ mksamplejournals:
# # /etc/github-post-receive.conf # # /etc/github-post-receive.conf
# # 2. cron, nightly. Config: /etc/crontab # # 2. cron, nightly. Config: /etc/crontab
# # 3. manually: "make site" on hledger.org, or "make hledgerorg" elsewhere (cf Makefile.local). # # 3. manually: "make site" on hledger.org, or "make hledgerorg" elsewhere (cf Makefile.local).
# .PHONY: site # .PHONY: site
# # Use the existing Shake executable without recompiling it, so as not to automatially run unreviewed code by hook ? I think this no longer applies. # # Use the existing Shake executable without recompiling it, so as not to automatially run unreviewed code by hook ? I think this no longer applies.
# # site: $(call def-help,site-build, update the hledger.org website (run this on hledger.org, or run "make hledgerorg" elsewhere) ) # # site: $(call def-help,site-build, update the hledger.org website (run this on hledger.org, or run "make hledgerorg" elsewhere) )
# # @[ ! -x Shake ] \ # # @[ ! -x Shake ] \
@ -767,12 +699,9 @@ mksamplejournals:
# # echo; \ # # echo; \
# # ./Shake -V site; \ # # ./Shake -V site; \
# # ) 2>&1 | tee -a site.log # # ) 2>&1 | tee -a site.log
# site: Shake \ # site: Shake \
# $(call def-help,site, update the hledger.org website (run on hledger.org, or run "make hledgerorg" elsewhere) ) # $(call def-help,site, update the hledger.org website (run on hledger.org, or run "make hledgerorg" elsewhere) )
# ./Shake -V site 2>&1 | tee -a site.log # ./Shake -V site 2>&1 | tee -a site.log
# BROWSE=open # BROWSE=open
# BROWSEDELAY=5 # BROWSEDELAY=5
# LOCALSITEURL=http://localhost:3000/dev/hledger.html # LOCALSITEURL=http://localhost:3000/dev/hledger.html
@ -780,7 +709,6 @@ mksamplejournals:
# @make -s Shake # @make -s Shake
# @(printf "\nbrowser will open in $(BROWSEDELAY)s (adjust BROWSE in Makefile if needed)...\n\n"; sleep $(BROWSEDELAY); $(BROWSE) $(LOCALSITEURL)) & # @(printf "\nbrowser will open in $(BROWSEDELAY)s (adjust BROWSE in Makefile if needed)...\n\n"; sleep $(BROWSEDELAY); $(BROWSE) $(LOCALSITEURL)) &
# @$(WATCHEXEC) --print-events -e md,m4 -i hledger.md -i hledger-ui.md -i hledger-web.md -r './Shake webmanuals && ./Shake orgfiles && make -sC site serve' # @$(WATCHEXEC) --print-events -e md,m4 -i hledger.md -i hledger-ui.md -i hledger-web.md -r './Shake webmanuals && ./Shake orgfiles && make -sC site serve'
# ** installing # ** installing
INSTALLING: INSTALLING:
@ -799,8 +727,6 @@ INSTALLING:
# # update shell completions in hledger package # # update shell completions in hledger package
# shellcompletions: # shellcompletions:
# make -C hledger/shell-completion/ clean-all all # make -C hledger/shell-completion/ clean-all all
# ** releasing # ** releasing
RELEASING: RELEASING:
@ -910,67 +836,52 @@ _gitSwitchAutoCreate BRANCH:
git switch -c {{ BRANCH }} git switch -c {{ BRANCH }}
fi fi
# ############################################################################### # ###############################################################################
# $(call def-help-subheading,RELEASING:) # $(call def-help-subheading,RELEASING:)
# # old/desired release process: # # old/desired release process:
# # a normal release: echo 0.7 >.version; make release # # a normal release: echo 0.7 >.version; make release
# # a bugfix release: echo 0.7.1 >.version; make release # # a bugfix release: echo 0.7.1 >.version; make release
# #release: releasetest bumpversion tagrelease $(call def-help,release, prepare and test a release and tag the repo ) # #release: releasetest bumpversion tagrelease $(call def-help,release, prepare and test a release and tag the repo )
# #publish: hackageupload pushtags $(call def-help,upload, publish latest hackage packages and push tags to github ) # #publish: hackageupload pushtags $(call def-help,upload, publish latest hackage packages and push tags to github )
# #releaseandpublish: release upload $(call def-help,releaseandpublish, release and upload and publish updated docs ) # #releaseandpublish: release upload $(call def-help,releaseandpublish, release and upload and publish updated docs )
# ISCLEAN=git diff-index --quiet HEAD -- # ISCLEAN=git diff-index --quiet HEAD --
# # stop if the working directory has uncommitted changes # # stop if the working directory has uncommitted changes
# iscleanwd: # iscleanwd:
# @$(ISCLEAN) || (echo "please clean the working directory first"; false) # @$(ISCLEAN) || (echo "please clean the working directory first"; false)
# # stop if the given file(s) have uncommitted changes # # stop if the given file(s) have uncommitted changes
# isclean-%: # isclean-%:
# @$(ISCLEAN) $* || (echo "please clean these files first: $*"; false) # @$(ISCLEAN) $* || (echo "please clean these files first: $*"; false)
# # update all cabal files based on latest package.yaml files using stack's built-in hpack # # update all cabal files based on latest package.yaml files using stack's built-in hpack
# cabal: $(call def-help,cabal, regenerate cabal files from package.yaml files with stack ) # cabal: $(call def-help,cabal, regenerate cabal files from package.yaml files with stack )
# $(STACK) build --dry-run --silent # $(STACK) build --dry-run --silent
# # Update all cabal files based on latest package.yaml files using a specific hpack version. # # Update all cabal files based on latest package.yaml files using a specific hpack version.
# # To avoid warnings, this should be the same version as stack's built-in hpack. # # To avoid warnings, this should be the same version as stack's built-in hpack.
# cabal-with-hpack-%: # cabal-with-hpack-%:
# $(STACK) build --with-hpack hpack-$* --dry-run --silent # $(STACK) build --with-hpack hpack-$* --dry-run --silent
# # updatecabal: gencabal $(call def-help,updatecabal, regenerate cabal files and commit ) # # updatecabal: gencabal $(call def-help,updatecabal, regenerate cabal files and commit )
# # @read -p "please review changes then press enter to commit $(shell ls */*.cabal)" # # @read -p "please review changes then press enter to commit $(shell ls */*.cabal)"
# # git commit -m "update cabal files" $(shell ls */*.cabal) # # git commit -m "update cabal files" $(shell ls */*.cabal)
# # we use shake for this job; so dependencies aren't checked here # # we use shake for this job; so dependencies aren't checked here
# manuals: Shake $(call def-help,manuals, regenerate and commit CLI help and manuals (might need -B) ) # manuals: Shake $(call def-help,manuals, regenerate and commit CLI help and manuals (might need -B) )
# ./Shake manuals # ./Shake manuals
# git commit -m ";doc: regen manuals" -m "[ci skip]" hledger*/hledger*.{1,5,info,txt} hledger/Hledger/Cli/Commands/*.txt # git commit -m ";doc: regen manuals" -m "[ci skip]" hledger*/hledger*.{1,5,info,txt} hledger/Hledger/Cli/Commands/*.txt
# tag: $(call def-help,tag, make git release tags for the project and all packages ) # tag: $(call def-help,tag, make git release tags for the project and all packages )
# @for p in $(PACKAGES); do make tag-$$p; done # @for p in $(PACKAGES); do make tag-$$p; done
# @make tag-project # @make tag-project
# tag-%: $(call def-help,tag-PKG, make a git release tag for PKG ) # tag-%: $(call def-help,tag-PKG, make a git release tag for PKG )
# git tag -fs $*-`cat $*/.version` -m "Release $*-`cat $*/.version`" # git tag -fs $*-`cat $*/.version` -m "Release $*-`cat $*/.version`"
# tag-project: $(call def-help,tag-project, make a git release tag for the project as a whole ) # tag-project: $(call def-help,tag-project, make a git release tag for the project as a whole )
# git tag -fs `cat .version` -m "Release `cat .version`, https://hledger.org/release-notes.html#hledger-`cat .version | sed -e 's/\./-/g'`" # git tag -fs `cat .version` -m "Release `cat .version`, https://hledger.org/release-notes.html#hledger-`cat .version | sed -e 's/\./-/g'`"
# @printf "if tagging a major release, please also review and run this command:\n" # @printf "if tagging a major release, please also review and run this command:\n"
# @printf " git tag -fs `cat .version`.99 master -m \"Start of next release cycle. This tag influences git describe and dev builds' version strings.\"\n" # @printf " git tag -fs `cat .version`.99 master -m \"Start of next release cycle. This tag influences git describe and dev builds' version strings.\"\n"
# # hackageupload-dry: \ # # hackageupload-dry: \
# # $(call def-help,hackageupload-dry,\ # # $(call def-help,hackageupload-dry,\
# # upload all packages to hackage; dry run\ # # upload all packages to hackage; dry run\
# # ) # # )
# # for p in $(PACKAGES); do cabal upload $$p/dist/$$p-$(VERSION).tar.gz -v2 --check; done # # for p in $(PACKAGES); do cabal upload $$p/dist/$$p-$(VERSION).tar.gz -v2 --check; done
# hackageupload: \ # hackageupload: \
# $(call def-help,hackageupload, upload all packages to hackage from a release branch) # $(call def-help,hackageupload, upload all packages to hackage from a release branch)
# tools/hackageupload $(PACKAGES) # tools/hackageupload $(PACKAGES)
# # showreleasestats stats: \ # # showreleasestats stats: \
# # showreleasedays \ # # showreleasedays \
# # showunreleasedchangecount \ # # showunreleasedchangecount \
@ -984,9 +895,7 @@ _gitSwitchAutoCreate BRANCH:
# # show project stats useful for release notes\ # # show project stats useful for release notes\
# # ) # # )
# # # showerrors # # # showerrors
# # FROMTAG=. # # FROMTAG=.
# # showreleasedays: \ # # showreleasedays: \
# # $(call def-help,showreleasedays,\ # # $(call def-help,showreleasedays,\
# # \ # # \
@ -994,7 +903,6 @@ _gitSwitchAutoCreate BRANCH:
# # @echo Days since last release: # # @echo Days since last release:
# # @tools/dayssincetag.hs $(FROMTAG) | head -1 | cut -d' ' -f-1 # # @tools/dayssincetag.hs $(FROMTAG) | head -1 | cut -d' ' -f-1
# # @echo # # @echo
# # # XXX # # # XXX
# # showunreleasedchangecount: \ # # showunreleasedchangecount: \
# # $(call def-help,showunreleasedchangecount,\ # # $(call def-help,showunreleasedchangecount,\
@ -1003,40 +911,30 @@ _gitSwitchAutoCreate BRANCH:
# # @echo Commits since last release: # # @echo Commits since last release:
# # @darcs changes --from-tag $(FROMTAG) --count # # @darcs changes --from-tag $(FROMTAG) --count
# # @echo # # @echo
# describe: $(call def-help,describe, show a precise git-describe version string ) # describe: $(call def-help,describe, show a precise git-describe version string )
# @git describe --tags --match 'hledger-[0-9]*' --dirty # @git describe --tags --match 'hledger-[0-9]*' --dirty
# # showreleaseauthors: $(call def-help,showreleaseauthors, show author names since last release) # # showreleaseauthors: $(call def-help,showreleaseauthors, show author names since last release)
# # @echo Commit authors since last release: # # @echo Commit authors since last release:
# # @git shortlog -sn $(CHANGELOGSTART).. # TODO undefined # # @git shortlog -sn $(CHANGELOGSTART).. # TODO undefined
# showauthors: $(call def-help,showauthors, show all commit author names) # showauthors: $(call def-help,showauthors, show all commit author names)
# @echo "Commit authors ($$(git shortlog -sn | wc -l | awk '{print $$1}'))": # @echo "Commit authors ($$(git shortlog -sn | wc -l | awk '{print $$1}'))":
# @git shortlog -sn # @git shortlog -sn
# cloc: $(call def-help,cloc, count lines of source code ) # cloc: $(call def-help,cloc, count lines of source code )
# @echo Lines of code including tests: # @echo Lines of code including tests:
# @cloc --exclude-lang=HTML --exclude-dir=.stack-work,.idea,dist,old,bin,doc,site,.tutorial-data,static,angular . # @cloc --exclude-lang=HTML --exclude-dir=.stack-work,.idea,dist,old,bin,doc,site,.tutorial-data,static,angular .
# SCC=scc -z --cocomo-project-type semi-detached -f wide -s code # SCC=scc -z --cocomo-project-type semi-detached -f wide -s code
# scc: $(call def-help,scc, count lines of source code with scc) # scc: $(call def-help,scc, count lines of source code with scc)
# @echo Lines of code including tests: # @echo Lines of code including tests:
# @$(SCC) -i hs,sh,m4,hamlet # @$(SCC) -i hs,sh,m4,hamlet
# sccv: $(call def-help,sccv, count lines of source code with scc showing all files) # sccv: $(call def-help,sccv, count lines of source code with scc showing all files)
# @echo Lines of code including tests: # @echo Lines of code including tests:
# @$(SCC) -i hs,sh,m4,hamlet --by-file # @$(SCC) -i hs,sh,m4,hamlet --by-file
# # `ls $(SOURCEFILES)` # # `ls $(SOURCEFILES)`
# # sloc: \ # # sloc: \
# # $(call def-help,sloc,\ # # $(call def-help,sloc,\
# # \ # # \
# # ) # # )
# # @sloccount hledger-lib hledger hledger-web # # @sloccount hledger-lib hledger hledger-web
# # cloc: \ # # cloc: \
# # $(call def-help,cloc,\ # # $(call def-help,cloc,\
# # \ # # \
@ -1052,7 +950,6 @@ _gitSwitchAutoCreate BRANCH:
# # @echo # # @echo
# # @echo "hledger-lib, hledger, hledger-web" # # @echo "hledger-lib, hledger, hledger-web"
# # @cloc -q hledger-lib hledger hledger-web 2>&1 | grep -v 'defined(' # # @cloc -q hledger-lib hledger hledger-web 2>&1 | grep -v 'defined('
# # showtestcount: \ # # showtestcount: \
# # $(call def-help,showtestcount,\ # # $(call def-help,showtestcount,\
# # \ # # \
@ -1062,7 +959,6 @@ _gitSwitchAutoCreate BRANCH:
# # @echo "Functional tests:" # # @echo "Functional tests:"
# # @make --no-print functest | egrep '^ Total' | awk '{print $$2}' # # @make --no-print functest | egrep '^ Total' | awk '{print $$2}'
# # @echo # # @echo
# # showunittestcoverage: \ # # showunittestcoverage: \
# # $(call def-help,showunittestcoverage,\ # # $(call def-help,showunittestcoverage,\
# # \ # # \
@ -1070,12 +966,10 @@ _gitSwitchAutoCreate BRANCH:
# # @echo Unit test coverage: # # @echo Unit test coverage:
# # @make --no-print quickcoverage | grep 'expressions' # # @make --no-print quickcoverage | grep 'expressions'
# # @echo # # @echo
# # # showerrors: # # # showerrors:
# # # @echo Known errors: # # # @echo Known errors:
# # # @awk '/^** errors/, /^** / && !/^** errors/' NOTES.org | grep '^\*\*\* ' | tail +1 # # # @awk '/^** errors/, /^** / && !/^** errors/' NOTES.org | grep '^\*\*\* ' | tail +1
# # # @echo # # # @echo
# # # XXX # # # XXX
# # showunpushedchanges showunpushed: \ # # showunpushedchanges showunpushed: \
# # $(call def-help,showunpushedchanges showunpushed,\ # # $(call def-help,showunpushedchanges showunpushed,\
@ -1084,7 +978,6 @@ _gitSwitchAutoCreate BRANCH:
# # @echo "Changes not yet pushed upstream (to `darcs show repo | grep 'Default Remote' | cut -c 17-`):" # # @echo "Changes not yet pushed upstream (to `darcs show repo | grep 'Default Remote' | cut -c 17-`):"
# # @-darcs push simon@joyful.com:/repos/hledger --dry-run | grep '*' | tac # # @-darcs push simon@joyful.com:/repos/hledger --dry-run | grep '*' | tac
# # @echo # # @echo
# # # XXX # # # XXX
# # showunreleasedcodechanges showunreleased showchanges: \ # # showunreleasedcodechanges showunreleased showchanges: \
# # $(call def-help,showunreleasedcodechanges showunreleased showchanges,\ # # $(call def-help,showunreleasedcodechanges showunreleased showchanges,\
@ -1093,7 +986,6 @@ _gitSwitchAutoCreate BRANCH:
# # @echo "hledger code changes since last release:" # # @echo "hledger code changes since last release:"
# # @darcs changes --from-tag $(FROMTAG) --matches "not (name docs: or name doc: or name site: or name tools:)" | grep '*' # # @darcs changes --from-tag $(FROMTAG) --matches "not (name docs: or name doc: or name site: or name tools:)" | grep '*'
# # @echo # # @echo
# # # XXX # # # XXX
# # showcodechanges: \ # # showcodechanges: \
# # $(call def-help,showcodechanges,\ # # $(call def-help,showcodechanges,\
@ -1102,19 +994,14 @@ _gitSwitchAutoCreate BRANCH:
# # @echo "hledger code changes:" # # @echo "hledger code changes:"
# # @darcs changes --matches "not (name docs: or name site: or name tools:)" | egrep '^ +(\*|tagged)' # # @darcs changes --matches "not (name docs: or name site: or name tools:)" | egrep '^ +(\*|tagged)'
# # @echo # # @echo
# nix-hledger-version: $(call def-help,nix-hledger-version, show which version of hledger has reached nixpkgs) # nix-hledger-version: $(call def-help,nix-hledger-version, show which version of hledger has reached nixpkgs)
# @curl -s https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/development/haskell-modules/hackage-packages.nix | grep -A1 'pname = "hledger"' # @curl -s https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/development/haskell-modules/hackage-packages.nix | grep -A1 'pname = "hledger"'
# nix-hledger-versions: $(call def-help,nix-hledger-versions, show versions of all hledger packages in nixpkgs) # nix-hledger-versions: $(call def-help,nix-hledger-versions, show versions of all hledger packages in nixpkgs)
# @curl -s https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/development/haskell-modules/hackage-packages.nix | grep -A1 'pname = "hledger' # @curl -s https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/development/haskell-modules/hackage-packages.nix | grep -A1 'pname = "hledger'
# nix-view-commits: $(call def-help,nix-view-commits, show recent haskell commits in nixpkgs) # nix-view-commits: $(call def-help,nix-view-commits, show recent haskell commits in nixpkgs)
# @open 'https://github.com/NixOS/nixpkgs/commits/master/pkgs/development/haskell-modules/hackage-packages.nix' # @open 'https://github.com/NixOS/nixpkgs/commits/master/pkgs/development/haskell-modules/hackage-packages.nix'
# list-commits: $(call def-help,list-commits, list all commits chronologically and numbered) # list-commits: $(call def-help,list-commits, list all commits chronologically and numbered)
# @git log --format='%ad %h %s (%an)' --date=short --reverse | cat -n # @git log --format='%ad %h %s (%an)' --date=short --reverse | cat -n
# ** misc # ** misc
MISC: MISC:
@ -1167,7 +1054,7 @@ mkwebdirs:
@_listsourcedirs: @_listsourcedirs:
find . -name '*hs' | sed -e 's%[^/]*hs$%%' | sort | uniq find . -name '*hs' | sed -e 's%[^/]*hs$%%' | sort | uniq
# show the ghc versions used by all stack files # show the ghc versions used by all stack files
@_listghcversions: @_listghcversions:
for F in stack*.yaml; do {{ STACK }} --stack-yaml=$F --no-install-ghc exec -- ghc --version; done 2>&1 | grep -v 'To install the correct GHC' for F in stack*.yaml; do {{ STACK }} --stack-yaml=$F --no-install-ghc exec -- ghc --version; done 2>&1 | grep -v 'To install the correct GHC'
@ -1187,32 +1074,24 @@ mkwebdirs:
for p in ledger hledger beancount; do git -C ../$p log --format="%cd (%h) %s%n ($p) 1%n" --date=short --reverse >> project-commits.j; done for p in ledger hledger beancount; do git -C ../$p log --format="%cd (%h) %s%n ($p) 1%n" --date=short --reverse >> project-commits.j; done
echo "wrote project-commits.j" echo "wrote project-commits.j"
# ############################################################################### # ###############################################################################
# $(call def-help-subheading,MISCELLANEOUS:) # $(call def-help-subheading,MISCELLANEOUS:)
# installcommithook: $(call def-help,installcommithook, symlink tools/commitlint as .git/hooks/commit-msg) # installcommithook: $(call def-help,installcommithook, symlink tools/commitlint as .git/hooks/commit-msg)
# ln -s ../../tools/commitlint .git/hooks/commit-msg # ln -s ../../tools/commitlint .git/hooks/commit-msg
# watch-%: $(call def-help,watch-RULE, run make RULE repeatedly when any committed file changes) # watch-%: $(call def-help,watch-RULE, run make RULE repeatedly when any committed file changes)
# @git ls-files | entr -r make $* # @git ls-files | entr -r make $*
# Shake: Shake.hs $(call def-help,Shake, ensure the Shake script is compiled ) # Shake: Shake.hs $(call def-help,Shake, ensure the Shake script is compiled )
# ./Shake.hs # ./Shake.hs
# usage: cabalusage stackusage \ # usage: cabalusage stackusage \
# $(call def-help,usage, show size of various dirs ) # $(call def-help,usage, show size of various dirs )
# du -sh .git bin data doc extra # du -sh .git bin data doc extra
# du -sh . # du -sh .
# stackusage: \ # stackusage: \
# $(call def-help,stackusage, show size of stack working dirs if any ) # $(call def-help,stackusage, show size of stack working dirs if any )
# -du -shc `find . -name '.stack*'` # -du -shc `find . -name '.stack*'`
# cabalusage: \ # cabalusage: \
# $(call def-help,cabalusage, show size of cabal working dirs if any ) # $(call def-help,cabalusage, show size of cabal working dirs if any )
# -du -shc */dist* 2>/dev/null # -du -shc */dist* 2>/dev/null
# # Generate an emacs TAGS file. Tag: # # Generate an emacs TAGS file. Tag:
# # 1. haskell source files with hasktags # # 1. haskell source files with hasktags
# # 2. other source files recognised by (exuberant) ctags and not excluded by .ctags. Keep .ctags up to date. # # 2. other source files recognised by (exuberant) ctags and not excluded by .ctags. Keep .ctags up to date.
@ -1229,27 +1108,20 @@ mkwebdirs:
# Shake.hs \ # Shake.hs \
# ; do printf " \n$$f,1\n" >> TAGS; done # ; do printf " \n$$f,1\n" >> TAGS; done
# -etagsls >TAGS.files # -etagsls >TAGS.files
# etags-ls: # list files indexed in TAGS # etags-ls: # list files indexed in TAGS
# @rg -v '[  ]' TAGS | rg -r '$$1' '^(.*?)([0-9]+)?,[0-9,]+*' # @rg -v '[  ]' TAGS | rg -r '$$1' '^(.*?)([0-9]+)?,[0-9,]+*'
# cleantags: \ # cleantags: \
# $(call def-help-hide,cleantags, remove tag files ) # $(call def-help-hide,cleantags, remove tag files )
# rm -f TAGS tags # rm -f TAGS tags
# stackclean: \ # stackclean: \
# $(call def-help-hide,stackclean, remove .stack-work/ dirs ) # $(call def-help-hide,stackclean, remove .stack-work/ dirs )
# $(STACK) purge # $(STACK) purge
# cleanghco: \ # cleanghco: \
# $(call def-help-hide,cleanghc, remove ghc build leftovers ) # $(call def-help-hide,cleanghc, remove ghc build leftovers )
# rm -rf `find . -name "*.o" -o -name "*.hi" -o -name "*.dyn_o" -o -name "*.dyn_hi" -o -name "*~" | grep -vE '\.(stack-work|cabal-sandbox|virthualenv)'` # rm -rf `find . -name "*.o" -o -name "*.hi" -o -name "*.dyn_o" -o -name "*.dyn_hi" -o -name "*~" | grep -vE '\.(stack-work|cabal-sandbox|virthualenv)'`
# #rm -f `fd -I '\.(hi|o|dyn_hi|dyn_o)$'` # #rm -f `fd -I '\.(hi|o|dyn_hi|dyn_o)$'`
# clean: cleanghco \ # clean: cleanghco \
# $(call def-help,clean, default cleanup (ghc build leftovers) ) # $(call def-help,clean, default cleanup (ghc build leftovers) )
# Clean: stackclean cleanghco cleantags \ # Clean: stackclean cleanghco cleantags \
# $(call def-help,Clean, thorough cleanup (stack/ghc leftovers/tags) ) # $(call def-help,Clean, thorough cleanup (stack/ghc leftovers/tags) )
# # reverse = $(if $(wordlist 2,2,$(1)),$(call reverse,$(wordlist 2,$(words $(1)),$(1))) $(firstword $(1)),$(1)) # # reverse = $(if $(wordlist 2,2,$(1)),$(call reverse,$(wordlist 2,$(words $(1)),$(1))) $(firstword $(1)),$(1))