mirror of
https://github.com/simonmichael/hledger.git
synced 2024-10-06 10:57:30 +03:00
;doc: dev: update 'make' mentions to 'just'
This commit is contained in:
parent
81d67a1dd1
commit
5766d8fe7e
14
doc/CODE.md
14
doc/CODE.md
@ -181,11 +181,11 @@ $ (cd hledger-web; stack ghci hledger-web)
|
||||
hledger-web> :main --serve # restart: ctrl-c, :r, enter, ctrl-p, ctrl-p, enter
|
||||
```
|
||||
|
||||
- `make ghci-web`: runs the server in developer mode from GHCI, also
|
||||
- `just ghci-web`: runs the server in developer mode from GHCI, also
|
||||
interprets the hledger-lib and hledger packages so that :reload picks
|
||||
up changes in those packages too:
|
||||
```cli
|
||||
$ make ghci-web
|
||||
$ just ghci-web
|
||||
ghci> :main --serve
|
||||
```
|
||||
(This rule also creates symbolic links to hledger-web's `config`, `messages`, `static` and `templates`
|
||||
@ -195,12 +195,12 @@ directories, needed in developer mode, so it can run from the top directory. Thi
|
||||
|
||||
Relevant tools include:
|
||||
|
||||
- unit tests (HUnit, make unittest)
|
||||
- functional tests (shelltestrunner, make functest)
|
||||
- performance tests (simplebench, make bench)
|
||||
- documentation tests (make haddocktest + manual)
|
||||
- unit tests
|
||||
- functional tests
|
||||
- performance tests
|
||||
- documentation tests
|
||||
- ui tests (manual)
|
||||
- installation tests (manual)
|
||||
- installation tests
|
||||
- code reviews
|
||||
|
||||
## Code review
|
||||
|
@ -57,7 +57,7 @@ Some possible prefixes:
|
||||
|
||||
Before committing, pushing, or merging, run `tools/commitlint` to check recent commit messages.
|
||||
(See the script for more ways to select commits.) You can configure your local working copy
|
||||
to do this automatically, by running `make installcommithook`.
|
||||
to do this automatically, by running `just installcommithook`.
|
||||
|
||||
commitlint also runs automatically on Github to check pull requests.
|
||||
|
||||
|
@ -28,7 +28,7 @@ and by the innumerable other benefactors making it all possible.
|
||||
11231 commits in 16 years by 155 people as of 2022-12-21:
|
||||
|
||||
|
||||
<!-- year-end: update stats, make showauthors, replace table preserving notes (eg emacs macro), maybe fix root commits -->
|
||||
<!-- year-end: update stats, just authors, replace table preserving notes (eg emacs macro), maybe fix root commits -->
|
||||
| Commits | Author | Notes ([chat](#footer) me with updates!) |
|
||||
|---------|--------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| 9749 | Simon Michael | founder, project leader, lead developer |
|
||||
|
@ -5,8 +5,6 @@
|
||||
<!-- toc -->
|
||||
</div>
|
||||
|
||||
*Needs updating, eg make -> just*
|
||||
|
||||
## Get developer tools
|
||||
|
||||
Ensure [`stack`](https://haskell-lang.org/get-started) is installed
|
||||
@ -16,8 +14,9 @@ Ensure [`git`](https://git-scm.com) is installed. On Windows, it comes with stac
|
||||
|
||||
Here are some useful optional tools:
|
||||
|
||||
- [GNU Make](https://www.gnu.org/software/make): to use the convenient [Make rules](#make).
|
||||
- [`entr`](https://www.entrproject.org/) runs arbitrary commands when files change.
|
||||
- [`just`](https://github.com/casey/just) for automating project tasks
|
||||
- [GNU Make](https://www.gnu.org/software/make) for automating tasks in a few subdirectories
|
||||
- [`watchexec`](https://watchexec.github.io) for re-running commands when files change
|
||||
- [`ghcid`](https://hackage.haskell.org/package/ghcid) gives real-time GHC feedback as you make code changes.
|
||||
- [`shelltestrunner`](https://hackage.haskell.org/package/shelltestrunner) runs hledger's functional tests.
|
||||
- [`quickbench`](https://hackage.haskell.org/package/quickbench) measures and reports time taken by commands.
|
||||
@ -87,33 +86,33 @@ Runs any performance reports defined by each hledger package.
|
||||
|
||||
Times the end-user commands in `bench.sh` using quickbench.
|
||||
|
||||
make bench
|
||||
just bench
|
||||
|
||||
## Run functional tests
|
||||
|
||||
Runs the shelltestrunner tests defined in hledger/test/, which test the hledger CLI.
|
||||
|
||||
make functest
|
||||
just functest
|
||||
|
||||
## Run haddock tests
|
||||
|
||||
Checks for anything that would break haddock doc generation.
|
||||
|
||||
make haddocktest
|
||||
just haddocktest
|
||||
|
||||
Checks for the unit-tests embedded in documentation.
|
||||
|
||||
make doctest
|
||||
just doctest
|
||||
|
||||
## Simulate Travis tests
|
||||
|
||||
Locally runs tests similar to what we run on Travis CI.
|
||||
|
||||
make travistest
|
||||
just travistest
|
||||
|
||||
## Test with all supported GHC versions/stackage snapshots
|
||||
|
||||
make allsnapshotstest
|
||||
just allsnapshotstest
|
||||
|
||||
## Use GHCI
|
||||
|
||||
@ -207,15 +206,15 @@ Most docs tasks are handled by [Shake](#shake).
|
||||
|
||||
## Use ghcid for watching GHC/GHCI
|
||||
|
||||
[ghcid](https://hackage.haskell.org/package/ghcid) is the most reliable and fastest way to see GHC's feedback, and optionally run tests or a GHCI command, as you edit. We run it via make, for convenience and to watch multiple packages rather than just one. Run `make help-ghcid` to list related rules.
|
||||
[ghcid](https://hackage.haskell.org/package/ghcid) is the most reliable and fastest way to see GHC's feedback, and optionally run tests or a GHCI command, as you edit. We run it via just, for convenience and to watch multiple packages rather than just one. Run `just h ghcid` to list related rules.
|
||||
|
||||
### Watch for compile errors in hledger-lib and hledger:
|
||||
|
||||
make ghcid
|
||||
just ghcid
|
||||
|
||||
### Watch compile errors and the output of some hledger command:
|
||||
|
||||
ghcid -c 'make ghci' -T ':main -f a.j bal --budget -N'
|
||||
ghcid -c 'just ghci' -T ':main -f a.j bal --budget -N'
|
||||
|
||||
## Use --file-watch for watching stack
|
||||
|
||||
|
@ -75,7 +75,7 @@ The manuals and website are rendered from the top directory,
|
||||
primarily using Shake. First, build Shake:
|
||||
|
||||
```
|
||||
$ make Shake
|
||||
$ ./Shake.hs
|
||||
```
|
||||
|
||||
Then render the per-package manuals from markdown-m4 source files (*.m4.md)
|
||||
|
@ -13,7 +13,7 @@ They are generated by [`tools/generatejournal.hs`](https://github.com/simonmicha
|
||||
They should get built automatically as needed, if not you can use `make samplejournals`:
|
||||
|
||||
```cli
|
||||
$ make samplejournals
|
||||
$ just samplejournals
|
||||
ghc tools/generatejournal.hs
|
||||
[1 of 1] Compiling Main ( tools/generatejournal.hs, tools/generatejournal.o )
|
||||
Linking tools/generatejournal ...
|
||||
|
15
doc/FILES.md
15
doc/FILES.md
@ -254,23 +254,26 @@ src/hledger/tools/
|
||||
|
||||
## Sh/makefiles
|
||||
|
||||
Many developer tasks are automated with Make and/or Shake also.
|
||||
Run `make` or `./Shake` (after `make Shake`) to see help.
|
||||
Many developer tasks are automated via `Justfile` or `Shake.hs` also.
|
||||
Run `just` or `./Shake.hs` to see help.
|
||||
|
||||
<!-- $ gtree '(^|/)((bsd)?m|sh)ake' -->
|
||||
<pre>
|
||||
$ gtree '(^|/)((bsd)?m|sh)ake|justfile'
|
||||
src/hledger/
|
||||
Justfile
|
||||
Makefile
|
||||
Makefile.helpsys
|
||||
Shake.hs
|
||||
bin/
|
||||
justfile
|
||||
doc/
|
||||
MAKE.md
|
||||
SHAKE.md
|
||||
haskellerz/
|
||||
Makefile
|
||||
examples/
|
||||
csv/
|
||||
Makefile
|
||||
invoicing/
|
||||
makefile/
|
||||
pandoc-make-invoice/
|
||||
Makefile
|
||||
reports/
|
||||
Makefile
|
||||
|
51
doc/TESTS.md
51
doc/TESTS.md
@ -102,9 +102,6 @@ About testing in the hledger project, as of 201809.
|
||||
can always be run via the [test](https://hledger.org/hledger.html#test)
|
||||
command (`hledger test`).
|
||||
|
||||
Here\'s the quick way to run unit tests while developing:\
|
||||
`make ghcid-test` or `make ghcid-test-Some.Module`.
|
||||
|
||||
2. Doc tests
|
||||
|
||||
Like unit tests, but defined inside functions\' haddock
|
||||
@ -135,16 +132,8 @@ About testing in the hledger project, as of 201809.
|
||||
|
||||
4. Code tests
|
||||
|
||||
We have some tests aimed at testing eg code quality, generally
|
||||
defined as make rules, such as:
|
||||
|
||||
--------------------- -------------------------------------------------------------------------------------
|
||||
`make haddocktest` can haddock process all code docs without error
|
||||
`make buildtest` does all code build warning free with the default GHC version & stackage snapshot
|
||||
`make buildtestall` does the code build warning free with all supported GHC versions/stackage snapshots
|
||||
--------------------- -------------------------------------------------------------------------------------
|
||||
|
||||
See below for examples.
|
||||
We have some tests aimed at testing eg code quality, generally runnable via just.
|
||||
Eg `just haddocktest`, `just hlinttest`.
|
||||
|
||||
5. Package test suites
|
||||
|
||||
@ -187,20 +176,20 @@ tests, at least. It would be useful to set this up for hledger.
|
||||
Run unit tests:
|
||||
|
||||
``` example
|
||||
$ make unittest
|
||||
$ just unittest
|
||||
```
|
||||
|
||||
Run doctests:
|
||||
|
||||
``` example
|
||||
$ make doctest
|
||||
$ just doctest
|
||||
```
|
||||
|
||||
Run functional tests (and unit tests, now):
|
||||
|
||||
``` example
|
||||
$ stack install shelltestrunner
|
||||
$ make functest
|
||||
$ just functest
|
||||
```
|
||||
|
||||
Run the package tests (unit tests, maybe doctests, but not functional
|
||||
@ -213,25 +202,13 @@ $ stack test [PKG]
|
||||
Run \"default tests: package plus functional tests\":
|
||||
|
||||
``` example
|
||||
$ make test
|
||||
$ just test
|
||||
```
|
||||
|
||||
Test generation of haddock docs:
|
||||
|
||||
``` example
|
||||
$ make haddocktest
|
||||
```
|
||||
|
||||
Thorough test for build issues with current GHC:
|
||||
|
||||
``` example
|
||||
$ make buildtest
|
||||
```
|
||||
|
||||
Thorough test for build issues with all supported GHC versions:
|
||||
|
||||
``` example
|
||||
$ make buildtestall
|
||||
$ just haddocktest
|
||||
```
|
||||
|
||||
Run built-in hledger/hledger-lib unit tests via hledger command:
|
||||
@ -251,22 +228,16 @@ test [TESTPATTERN] [SEED]
|
||||
seed for easytests.
|
||||
```
|
||||
|
||||
Rebuild and rerun hledger/hledger-lib unit tests via ghcid:
|
||||
Rebuild and rerun hledger/hledger-lib doc tests via ghcid:
|
||||
|
||||
``` example
|
||||
$ make ghcid-test
|
||||
$ just ghcid-doctest
|
||||
```
|
||||
|
||||
Rebuild and rerun only some tests via ghcid (see hledger test --help):
|
||||
See all test-related just rules:
|
||||
|
||||
``` example
|
||||
$ make ghcid-test-TESTPATTERN
|
||||
```
|
||||
|
||||
See all test-related make rules:
|
||||
|
||||
``` example
|
||||
$ make help-test
|
||||
$ just h test
|
||||
```
|
||||
|
||||
|
||||
|
@ -59,8 +59,8 @@ Current process:
|
||||
- `PKG/package.yaml` contains the cabal package version declaration,
|
||||
bounds on other hledger packages, and a CPP VERSION macro used in
|
||||
`hledger/Hledger/Cli/Version.hs`. Changes in package.yaml will be
|
||||
propagated to `PKG/PKG.cabal` on the next stack or Shake build, or
|
||||
by `make gencabal`.
|
||||
propagated to `PKG/PKG.cabal` on the next stack build or --dry-run build
|
||||
or with `just cabalfiles`.
|
||||
|
||||
- `PKG/.version.m4` contains the _version_ macro used in documentation source files (*.m4.md). It is updated by `./Shake setversion`.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user