@@ -206,6 +206,31 @@ or Powerpoint to ensure that they weren't corrupted and that
206206they had the expected result, and mention the Word/Powerpoint
207207version and OS in your commit comment.
208208
209+Code style
210+----------
211+
212+Pandoc uses [hlint] to identify opportunities for code improvements
213+like redundant brackets or unnecessary `Language` extensions.
214+However, sometimes there are cases where there are good reasons to
215+use code different from what hlint proposes. In these cases, the
216+respective warning should be disabled in the file `.hlint.yaml`.
217+
218+There should be no errors when running `hlint .`; this is checked by
219+the continuous integration (CI) setup. It is recommended that
220+contributors check their code with a local hlint installation, but
221+relying on the CI is fine, too.
222+
223+A good way to ensure no new warnings are introduced is to use a Git
224+[pre-commit hook] which runs hlint on all updated Haskell files
225+before creating a commit:
226+
227+ #!/bin/sh
228+ git diff --cached --name-only | grep '.hs$' | xargs hlint
229+
230+Saving this to `.git/hooks/pre-commit`, and making the script
231+executable, will prevent accidental introduction of potentially
232+problematic code.
233+
209234Benchmarks
210235----------
211236
@@ -359,7 +384,9 @@ you may want to consider submitting a pull request to the
359384[FAQs]: http://pandoc.org/faqs.html
360385[EditorConfig]: http://editorconfig.org/
361386[Haskell platform]: http://www.haskell.org/platform/
387+[hlint]: https://hackage.haskell.org/package/hlint
362388[hsb2hs]: http://hackage.haskell.org/package/hsb2hs
389+[pre-commit hook]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
363390[GitHub labels]: https://github.com/jgm/pandoc/labels
364391[good first issue]:https://github.com/jgm/pandoc/labels/good%20first%20issue
365392[enhancement]: https://github.com/jgm/pandoc/labels/enhancement