Skip to content

Commit e6db31e

Browse files
committed
HLint: Use the cabal_macros.h generated from stack/lts-8
1 parent cbec132 commit e6db31e

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ before_cache:
1919

2020
matrix:
2121
include:
22+
- env: BUILD=hlint CABALVER=1.24 GHCVER=8.0.2
23+
compiler: ": #GHC 8.0.2"
24+
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}
2225
- env: BUILD=stack CABALVER=1.24 GHCVER=8.0.2 STACK_YAML=stack-bench.yaml
2326
compiler: ": #GHC 8.0.2"
2427
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}
@@ -40,9 +43,6 @@ matrix:
4043
- env: BUILD=cabal CABALVER=1.22 GHCVER=7.10.3
4144
compiler: ": #GHC 7.10.3"
4245
addons: {apt: {packages: [cabal-install-1.22,ghc-7.10.3], sources: [hvr-ghc]}}
43-
- env: BUILD=hlint CABALVER=1.24 GHCVER=8.0.2
44-
compiler: ": #GHC 8.0.2"
45-
addons: {apt: {packages: [cabal-install-1.24,ghc-8.0.2], sources: [hvr-ghc]}}
4646

4747
before_install:
4848
- unset CC

Data/Aeson/Internal/Time.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@ module Data.Aeson.Internal.Time
2020
import Prelude ()
2121
import Prelude.Compat
2222

23-
import Data.Fixed (Pico)
2423
import Data.Int (Int64)
2524
import Data.Time
2625
import Unsafe.Coerce (unsafeCoerce)
2726

2827
#if MIN_VERSION_base(4,7,0)
2928

30-
import Data.Fixed (Fixed(MkFixed))
29+
import Data.Fixed (Pico, Fixed(MkFixed))
3130

3231
toPico :: Integer -> Pico
3332
toPico = MkFixed
@@ -37,6 +36,8 @@ fromPico (MkFixed i) = i
3736

3837
#else
3938

39+
import Data.Fixed (Pico)
40+
4041
toPico :: Integer -> Pico
4142
toPico = unsafeCoerce
4243

Data/Aeson/Parser/Internal.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,8 @@ jstring_ = {-# SCC "jstring_" #-} do
221221
in Just (S a')
222222

223223
data S = S Int#
224+
-- This hint will no longer trigger once hlint > 1.9.41 is released.
225+
{-# ANN S ("HLint: ignore Use newtype instead of data" :: String) #-}
224226
#else
225227
startState = False
226228
go a c

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
lint:
2-
hlint --cpp-include include/ .
2+
hlint --cpp-include include/ --cpp-file .stack-work/dist/*/*Cabal-*/build/autogen/cabal_macros.h .

travis/script.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ case $BUILD in
2020
(cd dist && cabal install --force-reinstalls "$SRC_TGZ")
2121
;;
2222
hlint)
23+
stack build --fast aeson --stack-yaml stack-lts8.yaml --system-ghc --no-terminal
2324
stack install hlint --resolver lts-8 --system-ghc --no-terminal
2425
make lint
2526
;;

0 commit comments

Comments
 (0)