Skip to content

Commit f6a5262

Browse files
authored
Merge pull request #374 from rbasso/travis-add-hlint
travis: Add hlint to Travis-CI checks
2 parents 8a0a6d7 + c106512 commit f6a5262

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

.travis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,16 @@ install:
2828
- travis_retry fetch-configlet
2929
- travis_retry curl -L https://www.stackage.org/stack/linux-x86_64 -o pack.tgz
3030
- tar xzf pack.tgz --wildcards --strip-components=1 -C ${HOME}/bin '*/stack'
31+
- stack --resolver ${RESOLVER} --install-ghc install hlint
3132

3233
script:
3334
- |
3435
set -e
35-
configlet .
3636
37-
# Explicit set the resolver only if it's not the current one.
37+
configlet . # Check basic track configuration.
38+
hlint ${TRAVIS_BUILD_DIR} # Run `hlint` on the entire repository.
39+
40+
# Explicit set exercises' resolver only if it's not the current one.
3841
if [ "${CURRENT}" != "YES" ]; then
3942
SET_RESOLVER="--resolver ${RESOLVER}"
4043
fi

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,16 @@ stack test --pedantic
5050

5151
### Running HLint
5252

53-
All code in this repository should be as idiomatic as possible, so it is
54-
highly recommended to run `hlint` on your sources before opening a
55-
*pull request*.
53+
All code in this repository should be as idiomatic as possible, so we
54+
enforce in [Travis-CI] that it returns `No hints` when processed by
55+
HLint.
5656

57-
Unless there is a good reason to ignore a suggestion, all submitted
58-
code is expected to return **No hints** when processed by it.
57+
It is highly recommended to run `hlint` on your sources before opening
58+
a *pull request*, so you can fix your code before submitting it for review.
59+
60+
If you are certain that a suggestion given by `hlint` would make the
61+
code worse, you can [suppress it](https://github.com/ndmitchell/hlint#customizing-the-hints)
62+
with annotations in the source file.
5963

6064
## License
6165

0 commit comments

Comments
 (0)