on 0.0.4.0 help sign in
ormolu/CONTRIBUTING.md
64 lines 2.3 kB history raw
1# Contributing
3Issues (bugs, feature requests or otherwise feedback) may be reported in
4[the GitHub issue tracker for this project][issues]. Pull requests are also
5welcome.
7When contributing to this repository, please first discuss the change you
8wish to make via an issue, unless it's entirely trivial (typo fixes, etc.).
9If there is already an issue that describes the change you have in mind,
10comment on it indicating that you're going to work on that. This way we can
11avoid the situation when several people work on the same thing.
13Please make sure that all non-trivial changes are described in commit
14messages and PR descriptions.
16## What to hack on?
18* [Fixing bugs][bugs]. This is the main focus right now.
20### Testing
22Testing has been taken good care of and now it amounts to just adding
23examples under `data/examples`. Each example is a pair of files:
24`<example-name>.hs` for input and `<example-name>-out.hs` for corresponding
25expected output.
27Testing is performed as following:
29* Given snippet of source code is parsed and pretty-printed.
30* The result of printing is parsed back again and the AST is compared to the
31 AST obtained from the original file. They should match.
32* The output of printer is checked against the expected output.
33* Idempotency property is verified: formatting already formatted code
34 results in exactly the same output.
36Examples can be organized in sub-directories, see the existing ones for
37inspiration.
39Please note that we try to keep individual files at most 25 lines long
40because otherwise it's hard to figure out want went wrong when a test fails.
42## CI
44We use Circle CI. Some outside contributors may have problems, as in, CI
45won't run for PRs opened from forks with “unauthorized” errors. In that case
46the best we can do is to add you as a contributor or to restart your build
47manually.
49If you have been added as a contributor but the builds still do not start,
50try clicking
52```
53User settings -> Account integrations -> Refresh permissions
54```
56in Circle CI app.
58## Formatting
60Use `format.sh` script to format Ormolu with current version of Ormolu. If
61Ormolu is not formatted like this, the CI will fail.
63[issues]: https://github.com/tweag/ormolu/issues
64[bugs]: https://github.com/tweag/ormolu/issues?q=is%3Aissue+is%3Aopen+label%3Abug