Skip to content

Commit 5dc282b

Browse files
committed
Added QA instructions
1 parent 82468ae commit 5dc282b

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,3 +207,35 @@ The `include-dirs` is a list of directories containing C headers to be included.
207207
The `install-includes` will ensure that these headers (relative to the include-dirs) are also exported to any downstream package that depends on this package. So they can make use of those same headers, if they were also writing their own C code.
208208

209209
Finally you just need to write code like `FFI.hs`, and everything just works normally.
210+
211+
## Quality Assurance
212+
213+
### Hlint
214+
215+
Use `hlint` to lint your Haskell code which can suggest better ways of writing Haskell expressions.
216+
217+
```sh
218+
hlint lint ./src ./app ./test
219+
```
220+
221+
Hlint will give suggestions that aren't always relevant. In order to ignore these suggestions, they must be recorded like:
222+
223+
```sh
224+
hlint lint ./src ./app ./test --default > ./.hlint.yaml
225+
```
226+
227+
### Brittany
228+
229+
Use `brittany` to automatically format your code.
230+
231+
```sh
232+
find ./src ./app ./test -type f -name '*.hs' -print0 | xargs -0 -I{} sh -c 'brittany --check-mode "{}" || echo "{}"; exit 1'
233+
```
234+
235+
In order to apply the formatting to each file:
236+
237+
```sh
238+
brittany --write-mode inplace ./src/Demo.hs ./app/library/Main.hs
239+
```
240+
241+
Then use `git diff` to find the actual difference.

0 commit comments

Comments
 (0)