Recommend doing make check pre-commit

This commit is contained in:
steve-chavez
2019-09-30 08:46:31 -05:00
committed by Steve Chávez
parent 75a42b77ea
commit eebe319bfd
3 changed files with 11 additions and 13 deletions
+2 -2
View File
@@ -109,10 +109,10 @@ jobs:
test/io-tests.sh test/io-tests.sh
- run: - run:
name: run linter name: run linter
command: git ls-files | grep '\.l\?hs$' | xargs stack exec -- hlint -X QuasiQuotes -X NoPatternSynonyms "$@" command: make lint
- run: - run:
name: run styler name: run styler
command: git ls-files | grep '\.l\?hs$' | xargs stack exec -- stylish-haskell -i && git diff-index --exit-code HEAD -- '*.hs' '*.lhs' command: make style
build-test-9.6: build-test-9.6:
docker: docker:
+5 -6
View File
@@ -42,14 +42,13 @@ your contributions.
* All contributions must pass the tests before being merged. When * All contributions must pass the tests before being merged. When
you create a pull request your code will automatically be tested. you create a pull request your code will automatically be tested.
* All code must also pass [hlint](http://community.haskell.org/~ndm/hlint/) * All code must also pass [hlint](http://community.haskell.org/~ndm/hlint/) and [stylish-haskell](https://github.com/jaspervdj/stylish-haskell)
with no warnings. This helps enforce a uniform style for all with no warnings. This helps enforce a uniform style for all committers. Continuous integration will check this as well on every
committers. Continuous integration will check this as well on every pull request. There's a useful Makefile that helps with checking this locally. You can run `make commit-check` to do this manually but
pull request. we recommend adding it to `.git/hooks/pre-commit` to automatically check this before doing a commit.
* For help building the Haskell code on your computer check out the [building from * For help building the Haskell code on your computer check out the [building from
source](https://postgrest.com/en/stable/install.html#build-from-source) source](https://postgrest.com/en/stable/install.html#build-from-source) docs section.
wiki page.
### Running Tests ### Running Tests
+4 -5
View File
@@ -1,4 +1,6 @@
.PHONY: check clean lint style test test-watch coverage circleci circleci-prof-test check-dburi prompt-clean prompt-long-process .PHONY: commit-check check clean lint style test test-watch coverage circleci circleci-prof-test check-dburi prompt-clean prompt-long-process
commit-check: lint style
check: lint style test check: lint style test
@@ -9,8 +11,7 @@ lint:
git ls-files | grep '\.l\?hs$$' | xargs stack exec -- hlint -X QuasiQuotes -X NoPatternSynonyms "$$@" git ls-files | grep '\.l\?hs$$' | xargs stack exec -- hlint -X QuasiQuotes -X NoPatternSynonyms "$$@"
style: style:
git ls-files | grep '\.l\?hs$$' | xargs stack exec -- stylish-haskell -i git ls-files | grep '\.l\?hs$$' | xargs stack exec -- stylish-haskell -i && git diff-index --exit-code HEAD -- '*.hs' '*.lhs'
test: check-dburi test: check-dburi
stack test stack test
@@ -22,14 +23,12 @@ coverage: check-dburi clean
stack build --coverage stack build --coverage
stack test --coverage stack test --coverage
circleci: prompt-long-process circleci: prompt-long-process
circleci local execute --job build-test-9.4 circleci local execute --job build-test-9.4
circleci-prof-test: prompt-long-process circleci-prof-test: prompt-long-process
circleci local execute --job build-prof-test circleci local execute --job build-prof-test
check-dburi: check-dburi:
test -n "$(POSTGREST_TEST_CONNECTION)" # Requires POSTGREST_TEST_CONNECTION environmental variable test -n "$(POSTGREST_TEST_CONNECTION)" # Requires POSTGREST_TEST_CONNECTION environmental variable