-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
64 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Contributing | ||
|
||
Refer to the [(original) Liquid contribution guidelines](https://github.com/Shopify/liquid/blob/master/CONTRIBUTING.md). | ||
|
||
In addition to those checklists, I also won't merge: | ||
|
||
- [ ] Performance improvements that don't include a benchmark. | ||
- [ ] Meager (<3%) performance improvements that increase code verbosity or complexity. | ||
|
||
A caveat: The cyclomatic complexity checks on generated functions, hand-written parsers, and some of the generic interpreter functions, have been disabled (via `nolint: gocyclo`). IMO this check isn't appropriate for those classes of functions. This isn't a license to disable cyclomatic complexity or lint in general. | ||
|
||
## 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: | ||
|
||
* `make install-dev-tools` | ||
* `go get -t ./...` | ||
|
||
### Test and Lint | ||
|
||
```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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters