;doc: dev: update 'make' mentions to 'just'

This commit is contained in:
Simon Michael 2024-04-24 08:39:07 -10:00
parent 81d67a1dd1
commit 5766d8fe7e
9 changed files with 45 additions and 72 deletions

View File

@ -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 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 interprets the hledger-lib and hledger packages so that :reload picks
up changes in those packages too: up changes in those packages too:
```cli ```cli
$ make ghci-web $ just ghci-web
ghci> :main --serve ghci> :main --serve
``` ```
(This rule also creates symbolic links to hledger-web's `config`, `messages`, `static` and `templates` (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: Relevant tools include:
- unit tests (HUnit, make unittest) - unit tests
- functional tests (shelltestrunner, make functest) - functional tests
- performance tests (simplebench, make bench) - performance tests
- documentation tests (make haddocktest + manual) - documentation tests
- ui tests (manual) - ui tests (manual)
- installation tests (manual) - installation tests
- code reviews - code reviews
## Code review ## Code review

View File

@ -57,7 +57,7 @@ Some possible prefixes:
Before committing, pushing, or merging, run `tools/commitlint` to check recent commit messages. 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 (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. commitlint also runs automatically on Github to check pull requests.

View File

@ -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: 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!) | | Commits | Author | Notes ([chat](#footer) me with updates!) |
|---------|--------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |---------|--------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 9749 | Simon Michael | founder, project leader, lead developer | | 9749 | Simon Michael | founder, project leader, lead developer |

View File

@ -5,8 +5,6 @@
<!-- toc --> <!-- toc -->
</div> </div>
*Needs updating, eg make -> just*
## Get developer tools ## Get developer tools
Ensure [`stack`](https://haskell-lang.org/get-started) is installed 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: Here are some useful optional tools:
- [GNU Make](https://www.gnu.org/software/make): to use the convenient [Make rules](#make). - [`just`](https://github.com/casey/just) for automating project tasks
- [`entr`](https://www.entrproject.org/) runs arbitrary commands when files change. - [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. - [`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. - [`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. - [`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. Times the end-user commands in `bench.sh` using quickbench.
make bench just bench
## Run functional tests ## Run functional tests
Runs the shelltestrunner tests defined in hledger/test/, which test the hledger CLI. Runs the shelltestrunner tests defined in hledger/test/, which test the hledger CLI.
make functest just functest
## Run haddock tests ## Run haddock tests
Checks for anything that would break haddock doc generation. Checks for anything that would break haddock doc generation.
make haddocktest just haddocktest
Checks for the unit-tests embedded in documentation. Checks for the unit-tests embedded in documentation.
make doctest just doctest
## Simulate Travis tests ## Simulate Travis tests
Locally runs tests similar to what we run on Travis CI. Locally runs tests similar to what we run on Travis CI.
make travistest just travistest
## Test with all supported GHC versions/stackage snapshots ## Test with all supported GHC versions/stackage snapshots
make allsnapshotstest just allsnapshotstest
## Use GHCI ## Use GHCI
@ -207,15 +206,15 @@ Most docs tasks are handled by [Shake](#shake).
## Use ghcid for watching GHC/GHCI ## 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: ### Watch for compile errors in hledger-lib and hledger:
make ghcid just ghcid
### Watch compile errors and the output of some hledger command: ### 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 ## Use --file-watch for watching stack

View File

@ -75,7 +75,7 @@ The manuals and website are rendered from the top directory,
primarily using Shake. First, build Shake: primarily using Shake. First, build Shake:
``` ```
$ make Shake $ ./Shake.hs
``` ```
Then render the per-package manuals from markdown-m4 source files (*.m4.md) Then render the per-package manuals from markdown-m4 source files (*.m4.md)

View File

@ -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`: They should get built automatically as needed, if not you can use `make samplejournals`:
```cli ```cli
$ make samplejournals $ just samplejournals
ghc tools/generatejournal.hs ghc tools/generatejournal.hs
[1 of 1] Compiling Main ( tools/generatejournal.hs, tools/generatejournal.o ) [1 of 1] Compiling Main ( tools/generatejournal.hs, tools/generatejournal.o )
Linking tools/generatejournal ... Linking tools/generatejournal ...

View File

@ -254,23 +254,26 @@ src/hledger/tools/
## Sh/makefiles ## Sh/makefiles
Many developer tasks are automated with Make and/or Shake also. Many developer tasks are automated via `Justfile` or `Shake.hs` also.
Run `make` or `./Shake` (after `make Shake`) to see help. Run `just` or `./Shake.hs` to see help.
<!-- $ gtree '(^|/)((bsd)?m|sh)ake' -->
<pre> <pre>
$ gtree '(^|/)((bsd)?m|sh)ake|justfile'
src/hledger/ src/hledger/
Justfile
Makefile Makefile
Makefile.helpsys Makefile.helpsys
Shake.hs Shake.hs
bin/
justfile
doc/ doc/
MAKE.md
SHAKE.md
haskellerz/ haskellerz/
Makefile Makefile
examples/ examples/
csv/
Makefile
invoicing/ invoicing/
makefile/ pandoc-make-invoice/
Makefile Makefile
reports/ reports/
Makefile Makefile

View File

@ -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) can always be run via the [test](https://hledger.org/hledger.html#test)
command (`hledger 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 2. Doc tests
Like unit tests, but defined inside functions\' haddock Like unit tests, but defined inside functions\' haddock
@ -135,16 +132,8 @@ About testing in the hledger project, as of 201809.
4. Code tests 4. Code tests
We have some tests aimed at testing eg code quality, generally We have some tests aimed at testing eg code quality, generally runnable via just.
defined as make rules, such as: Eg `just haddocktest`, `just hlinttest`.
--------------------- -------------------------------------------------------------------------------------
`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.
5. Package test suites 5. Package test suites
@ -187,20 +176,20 @@ tests, at least. It would be useful to set this up for hledger.
Run unit tests: Run unit tests:
``` example ``` example
$ make unittest $ just unittest
``` ```
Run doctests: Run doctests:
``` example ``` example
$ make doctest $ just doctest
``` ```
Run functional tests (and unit tests, now): Run functional tests (and unit tests, now):
``` example ``` example
$ stack install shelltestrunner $ stack install shelltestrunner
$ make functest $ just functest
``` ```
Run the package tests (unit tests, maybe doctests, but not functional 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\": Run \"default tests: package plus functional tests\":
``` example ``` example
$ make test $ just test
``` ```
Test generation of haddock docs: Test generation of haddock docs:
``` example ``` example
$ make haddocktest $ just 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
``` ```
Run built-in hledger/hledger-lib unit tests via hledger command: Run built-in hledger/hledger-lib unit tests via hledger command:
@ -251,22 +228,16 @@ test [TESTPATTERN] [SEED]
seed for easytests. seed for easytests.
``` ```
Rebuild and rerun hledger/hledger-lib unit tests via ghcid: Rebuild and rerun hledger/hledger-lib doc tests via ghcid:
``` example ``` 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 ``` example
$ make ghcid-test-TESTPATTERN $ just h test
```
See all test-related make rules:
``` example
$ make help-test
``` ```

View File

@ -59,8 +59,8 @@ Current process:
- `PKG/package.yaml` contains the cabal package version declaration, - `PKG/package.yaml` contains the cabal package version declaration,
bounds on other hledger packages, and a CPP VERSION macro used in bounds on other hledger packages, and a CPP VERSION macro used in
`hledger/Hledger/Cli/Version.hs`. Changes in package.yaml will be `hledger/Hledger/Cli/Version.hs`. Changes in package.yaml will be
propagated to `PKG/PKG.cabal` on the next stack or Shake build, or propagated to `PKG/PKG.cabal` on the next stack build or --dry-run build
by `make gencabal`. or with `just cabalfiles`.
- `PKG/.version.m4` contains the _version_ macro used in documentation source files (*.m4.md). It is updated by `./Shake setversion`. - `PKG/.version.m4` contains the _version_ macro used in documentation source files (*.m4.md). It is updated by `./Shake setversion`.