Skip to content

Commit 8fb85c6

Browse files
authored
Merge pull request #191 from haskell-works/hlint-update
HLint update
2 parents d87c6dc + 9932de8 commit 8fb85c6

File tree

21 files changed

+108
-82
lines changed

21 files changed

+108
-82
lines changed

.circleci/config.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,12 @@ workflows:
3333
cabal-build-extra: --write-ghc-environment-files=ghc8.4.4+
3434
cabal-test-extra: --test-show-details=direct --test-options='+RTS -g1'
3535

36-
- haskell/build-with-binary-cache:
37-
name: GHC 8.10.2
38-
executor: haskell/ghc-8_10_2
39-
context: haskell-ci
40-
binary-cache-uri: ${BINARY_CACHE_URI-"http://hw-binary-cache-us-west-2-a.s3-website-us-west-2.amazonaws.com/archive"}
41-
cabal-build-extra: --write-ghc-environment-files=ghc8.4.4+
42-
cabal-test-extra: --test-show-details=direct --test-options='+RTS -g1'
43-
4436
- merge-point/merge-point:
4537
name: Build Ok
4638
requires:
4739
- GHC 8.4.4
4840
- GHC 8.6.5
4941
- GHC 8.8.3
50-
- GHC 8.10.2
5142

5243
- github/release-cabal:
5344
name: GitHub Release

.github/workflows/haskell.yml

Lines changed: 75 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,85 @@
1-
# This is a basic workflow to help you get started with Actions
1+
name: Haskell
22

3-
name: CI
3+
defaults:
4+
run:
5+
shell: bash
46

5-
# Controls when the action will run. Triggers the workflow on push or pull request
6-
# events but only for the master branch
7-
on:
8-
push:
9-
branches: [ master ]
10-
pull_request:
11-
branches: [ master ]
7+
on: [push]
128

13-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
149
jobs:
15-
# This workflow contains a single job called "build"
1610
build:
17-
# The type of runner that the job will run on
18-
runs-on: ubuntu-latest
11+
runs-on: ${{ matrix.os }}
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
ghc: ["8.8.4", "8.6.5", "8.8.3", "8.10.2"]
17+
os: [ubuntu-latest]
1918

20-
# Steps represent a sequence of tasks that will be executed as part of the job
2119
steps:
22-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2320
- uses: actions/checkout@v2
21+
with:
22+
submodules: true
23+
- uses: actions/setup-haskell@v1
24+
id: setup-haskell
25+
with:
26+
ghc-version: ${{ matrix.ghc }}
27+
28+
- name: Configure
29+
run: cabal configure --write-ghc-environment-files=ghc8.4.4+
30+
31+
- name: Restore cabal cache
32+
uses: haskell-works/cabal-cache-action@v1
33+
env:
34+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
35+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
36+
BINARY_CACHE_REGION: ${{ secrets.BINARY_CACHE_REGION }}
37+
BINARY_CACHE_THREADS: ${{ secrets.BINARY_CACHE_THREADS }}
38+
BINARY_CACHE_URI: ${{ secrets.BINARY_CACHE_URI }}
39+
with:
40+
args: |
41+
sync-from-archive \
42+
--threads "$BINARY_CACHE_THREADS" \
43+
--archive-uri "$BINARY_CACHE_URI" \
44+
--region "$BINARY_CACHE_REGION" \
45+
--store-path "${{ steps.setup-haskell.outputs.cabal-store }}"
46+
47+
- name: Build
48+
run: cabal build all
49+
50+
- name: Save cabal cache
51+
uses: haskell-works/cabal-cache-action@v1
52+
if: ${{ always() }}
53+
env:
54+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
55+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
56+
BINARY_CACHE_REGION: ${{ secrets.BINARY_CACHE_REGION }}
57+
BINARY_CACHE_THREADS: ${{ secrets.BINARY_CACHE_THREADS }}
58+
BINARY_CACHE_URI: ${{ secrets.BINARY_CACHE_URI }}
59+
with:
60+
args: |
61+
sync-to-archive \
62+
--threads "$BINARY_CACHE_THREADS" \
63+
--archive-uri "$BINARY_CACHE_URI" \
64+
--region "$BINARY_CACHE_REGION" \
65+
--store-path "${{ steps.setup-haskell.outputs.cabal-store }}"
2466
25-
# Runs a single command using the runners shell
26-
- name: Run a one-line script
27-
run: echo Hello, world!
67+
- name: Build
68+
run: cabal test all --test-show-details=direct
2869

29-
# Runs a set of commands using the runners shell
30-
- name: Run a multi-line script
31-
run: |
32-
echo Add other actions to build,
33-
echo test, and deploy your project.
70+
- name: Save cabal cache
71+
uses: haskell-works/cabal-cache-action@v1
72+
if: ${{ always() }}
73+
env:
74+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
75+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
76+
BINARY_CACHE_REGION: ${{ secrets.BINARY_CACHE_REGION }}
77+
BINARY_CACHE_THREADS: ${{ secrets.BINARY_CACHE_THREADS }}
78+
BINARY_CACHE_URI: ${{ secrets.BINARY_CACHE_URI }}
79+
with:
80+
args: |
81+
sync-to-archive \
82+
--threads "$BINARY_CACHE_THREADS" \
83+
--archive-uri "$BINARY_CACHE_URI" \
84+
--region "$BINARY_CACHE_REGION" \
85+
--store-path "${{ steps.setup-haskell.outputs.cabal-store }}"

app/App/Commands.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import App.Commands.CreateIndex
66
import App.Commands.Demo
77
import Options.Applicative
88

9+
{- HLINT ignore "Monoid law, left identity" -}
10+
911
commands :: Parser (IO ())
1012
commands = commandsGeneral
1113

app/App/Commands/Count.hs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ import qualified HaskellWorks.Data.Json.Standard.Cursor.Fast as JCF
3232
import qualified System.IO.MMap as IO
3333

3434
siblings :: GenericCursor BSI.ByteString CsPoppy1 (RM.RangeMin CsPoppy1) -> [GenericCursor BSI.ByteString CsPoppy1 (RM.RangeMin CsPoppy1)]
35-
siblings c = c:cs
36-
where cs = case nextSibling c of
37-
Just d -> siblings d
38-
Nothing -> []
35+
siblings c = c:maybe [] siblings (nextSibling c)
3936

4037
runCount :: Z.CountOptions -> IO ()
4138
runCount opts = do

app/App/Commands/CreateIndex.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ import qualified System.Exit
3232
import qualified System.IO as IO
3333
import qualified System.IO.MMap as IO
3434

35-
{-# ANN module ("HLint: ignore Reduce duplication" :: String) #-}
36-
{-# ANN module ("HLint: ignore Redundant do" :: String) #-}
35+
{- HLINT ignore "Reduce duplication" -}
36+
{- HLINT ignore "Redundant do" -}
3737

3838
runCreateIndexStandard :: Z.CreateIndexOptions -> IO ()
3939
runCreateIndexStandard opts = do

app/App/Commands/Demo.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ import qualified Options.Applicative as OA
3434
import qualified System.IO as IO
3535
import qualified System.IO.MMap as IO
3636

37+
{- HLINT ignore "Reduce duplication" -}
38+
3739
runDemo :: Z.DemoOptions -> IO ()
3840
runDemo opts = do
3941
let filePath = opts ^. the @"filePath"

bench/Main.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ import Criterion.Main
66

77
main :: IO ()
88
main = do
9-
benchmarks <- fmap mconcat $ sequence $ mempty
9+
benchmarks <- mconcat <$> sequence mempty
1010
defaultMain benchmarks

examples/Example4.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import HaskellWorks.Data.MQuery.Micro
1818

1919
import qualified Data.DList as DL
2020

21+
{- HLINT ignore "Reduce duplication" -}
22+
2123
example :: IO ()
2224
example = do
2325
!cursor <- loadPartial "corpus/bench/78mb.json"

src/HaskellWorks/Data/Json/FromValue.hs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
{-# LANGUAGE FlexibleInstances #-}
2-
{-# LANGUAGE TypeSynonymInstances #-}
1+
{-# LANGUAGE FlexibleInstances #-}
32

43
module HaskellWorks.Data.Json.FromValue where
54

src/HaskellWorks/Data/Json/Internal/Standard/Token/Tokenize.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
{-# LANGUAGE FlexibleInstances #-}
33
{-# LANGUAGE MultiParamTypeClasses #-}
44
{-# LANGUAGE OverloadedStrings #-}
5-
{-# LANGUAGE TypeSynonymInstances #-}
65

76
module HaskellWorks.Data.Json.Internal.Standard.Token.Tokenize
87
( IsChar(..)
@@ -25,6 +24,8 @@ import qualified Data.Attoparsec.Types as T
2524
import qualified Data.ByteString as BS
2625
import qualified HaskellWorks.Data.Parser as P
2726

27+
{- HLINT ignore "Reduce duplication" -}
28+
2829
hexDigitNumeric :: P.Parser t u => T.Parser t Int
2930
hexDigitNumeric = do
3031
c <- P.satisfyChar (\c -> '0' <= c && c <= '9')

0 commit comments

Comments
 (0)