2017-07-05 15:51:00 +02:00
# Contributing
2017-07-05 19:56:19 +02:00
Here's some ways to help:
2017-07-05 15:51:00 +02:00
2017-07-10 01:33:09 +02:00
* Select an item from the [issues list ](https://github.com/osteele/liquid/issues )
2017-07-07 15:35:47 +02:00
* Search the sources for FIXME and TODO comments.
2017-07-21 17:36:35 +02:00
* Improve the [code coverage ](https://coveralls.io/github/osteele/liquid?branch=master ).
2017-07-05 15:51:00 +02:00
2017-07-05 19:56:19 +02:00
Review the [pull request template ](https://github.com/osteele/liquid/blob/master/.github/PULL_REQUEST_TEMPLATE.md ) before you get too far along on coding.
2017-07-05 15:51:00 +02:00
2017-07-05 19:56:19 +02:00
A note on lint: `nolint: gocyclo` has been used to disable cyclomatic complexity checks on generated functions, hand-written parsers, and some of the generic interpreter functions. IMO this check isn't appropriate for those classes of functions. This isn't a license to disable cyclomatic complexity checks or lint in general.
2017-07-05 15:51:00 +02:00
## Cookbook
### Set up your machine
Fork and clone the repo.
[Install go ](https://golang.org/doc/install#install ). On macOS running Homebrew, `brew install go` is easier than the linked instructions.
Install package dependencies and development tools:
2017-07-13 02:04:55 +02:00
* `make setup`
2021-06-16 12:42:31 +02:00
[Install golangci-lint ](https://golangci-lint.run/usage/install/#local-installation ).
On macOS: `brew install golangci-lint`
2017-07-05 15:51:00 +02:00
### Test and Lint
2018-06-05 21:47:13 +02:00
```bash
make pre-commit
```
You can also do these individually:
2017-07-05 15:51:00 +02:00
```bash
go test ./...
make lint
```
### Preview the Documentation
```bash
godoc -http=:6060
open http://localhost:6060/pkg/github.com/osteele/liquid/
```
### Work on the Expression Parser and Lexer
To work on the lexer, install Ragel. On macOS: `brew install ragel` .
Do this after editing `scanner.rl` or `expressions.y` :
```bash
go generate ./...
```
Test just the scanner:
```bash
cd expression
ragel -Z scanner.rl & & go test
```