To fix this, build the hledger packages once, eg `stack build`.
(Or `stack build hledger` might be enough, depending what you are doing.)
### Get a GHCI prompt for hledger-lib:
cd hledger-lib; stack ghci hledger-lib
Changing into the package directory isn't actually needed, but it
enables a custom .ghci script which sets a more useful short prompt.
### Get a GHCI prompt for hledger:
cd hledger; stack ghci hledger
### Get a GHCI prompt for hledger-ui:
cd hledger-ui; stack ghci hledger-ui
### Get a GHCI prompt for hledger-web:
cd hledger-web; stack ghci hledger-web
hledger-web also needs to find some things in its current directory (like the static/ directory).
This normally just works, if not please [send details](https://github.com/simonmichael/hledger/issues/274).
## Add a test
- identify what to test
- choose the test type: unit ? functional ? benchmark ?
- currently expected to pass or fail ?
- figure out where it goes
- write test, verify expected result
- get it committed
## Fix a bug or add a feature
- research, discuss, validate the issue/feature on irc/list/bug tracker
- look for related tests, run the tests and check they are passing
- add a test ?
- develop a patch
- include any related issue numbers in the patch name, eg: "fix for blah blah (#NNN)"
- get it committed
## Get your changes accepted
Follow the usual github workflow:
- fork the main hledger repo on github,
- git clone it to your local machine,
- git commit, after (?) pulling and merging the latest upstream changes
- git push back to github,
- open a pull request on github,
- follow up on any discussion there.
If you're new to this process, [help.github.com](https://help.github.com) may be useful.
## Add yourself to the contributor list
- after getting something into the master branch, read and sign the [contributor list & agreement](https://hledger.org/contributors.html). Or, [ask](index.html#help-feedback) to be added.
- give yourself a high five!
## Work on docs
Most docs tasks are handled by [Shake](#shake).
### List Shake rules:
./Shake
### Generate man/info/txt manuals (in hledger*/) and embed in hledger executables:
./Shake manuals
stack build
### Generate html manuals and the hledger website (in site/_site/):
./Shake website
### To remove all files generated by Shake:
./Shake Clean
## 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.
### Watch for compile errors in hledger-lib and hledger:
make ghcid
### Watch compile errors and the output of some hledger command:
stack's --file-watch flag will re-run build/test/bench when source files or package.yaml/cabal files change. Eg:
stack test hledger --file-watch
If you find that adding --fast makes this any faster, please update this.
## Use entr for watching arbitrary commands
[entr](https://entrproject.org/) is the most robust cross-platform tool for watching files and running a command when they change. Note its first argument must be an executable program, to run a shell command or multiple commands use `bash -c "..."`.
### Rerun a single functional test as you change it: