Skip to content

Commit f218c99

Browse files
authored
Merge pull request #5811 from cabalism/add/stan
Add stan gh-action and ignore triggered checks
2 parents 3757ac9 + 2d9254a commit f218c99

File tree

5 files changed

+141
-4
lines changed

5 files changed

+141
-4
lines changed

.github/workflows/stan.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: stan
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build:
9+
name: ghc ${{ matrix.ghc }}
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
cabal: ["3.6"]
14+
ghc:
15+
- "8.10.7"
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
with:
20+
submodules: true
21+
22+
- uses: haskell/actions/setup@v1
23+
name: Setup GHC and cabal-install
24+
with:
25+
ghc-version: ${{ matrix.ghc }}
26+
cabal-version: ${{ matrix.cabal }}
27+
28+
- uses: actions/cache@v2
29+
name: cache ~/.cabal/store
30+
with:
31+
path: ~/.cabal/store
32+
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal
33+
34+
- name: update
35+
run: cabal update
36+
37+
- name: install stan
38+
run: cabal install stan --installdir=.bin --install-method=copy --overwrite-policy=always
39+
40+
- name: generate .hie for analysis
41+
run: cabal build stack:lib:stack
42+
43+
- name: stan
44+
run: .bin/stan report

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ tags
2929
better-cache/
3030
stack*.yaml.lock
3131
dist-newstyle/
32+
.hie
33+
stan.html

.stan.toml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Partial: base/!!
2+
[[check]]
3+
id = "STAN-0005"
4+
scope = "all"
5+
type = "Exclude"
6+
7+
# Partial: base/minimum
8+
[[check]]
9+
id = "STAN-0014"
10+
scope = "all"
11+
type = "Exclude"
12+
13+
# Partial: base/minimumBy
14+
[[check]]
15+
id = "STAN-0016"
16+
scope = "all"
17+
type = "Exclude"
18+
19+
# Partial: base/fromList
20+
[[check]]
21+
id = "STAN-0020"
22+
scope = "all"
23+
type = "Exclude"
24+
25+
# Infinite: base/reverse
26+
[[check]]
27+
id = "STAN-0101"
28+
scope = "all"
29+
type = "Exclude"
30+
31+
# Infinite: base/isSuffixOf
32+
[[check]]
33+
id = "STAN-0102"
34+
scope = "all"
35+
type = "Exclude"
36+
37+
# Infinite: base/length
38+
[[check]]
39+
id = "STAN-0103"
40+
scope = "all"
41+
type = "Exclude"
42+
43+
# Anti-pattern: foldl
44+
[[check]]
45+
id = "STAN-0202"
46+
scope = "all"
47+
type = "Exclude"
48+
49+
# Anti-pattern: Data.ByteString.Char8.pack
50+
[[check]]
51+
id = "STAN-0203"
52+
scope = "all"
53+
type = "Exclude"
54+
55+
# Data types with non-strict fields
56+
[[check]]
57+
id = "STAN-0206"
58+
scope = "all"
59+
type = "Exclude"
60+
61+
# Anti-pattern: Foldable methods on possibly error-prone structures
62+
[[check]]
63+
id = "STAN-0207"
64+
scope = "all"
65+
type = "Exclude"
66+
67+
# Anti-pattern: Slow 'length' for Text
68+
[[check]]
69+
id = "STAN-0208"
70+
scope = "all"
71+
type = "Exclude"
72+
73+
# Anti-pattern: unsafe functions
74+
[[check]]
75+
id = "STAN-0212"
76+
scope = "all"
77+
type = "Exclude"
78+
79+
# Anti-pattern: Pattern matching on '_'
80+
[[check]]
81+
id = "STAN-0213"
82+
scope = "all"
83+
type = "Exclude"
84+
85+
# Using tuples of big size (>= 4) can decrease code readability
86+
[[check]]
87+
id = "STAN-0302"
88+
scope = "all"
89+
type = "Exclude"

package.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ extra-source-files:
4040
- src/test/Stack/Untar/test1.tar.gz
4141
- src/test/Stack/Untar/test2.tar.gz
4242
ghc-options:
43+
- -fwrite-ide-info
44+
- -hiedir=.hie
4345
- -Wall
4446
- -fwarn-tabs
4547
- -fwarn-incomplete-uni-patterns

stack.cabal

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ library
223223
Paths_stack
224224
hs-source-dirs:
225225
src/
226-
ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates -optP-Wno-nonportable-include-path -fwarn-identities
226+
ghc-options: -fwrite-ide-info -hiedir=.hie -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates -optP-Wno-nonportable-include-path -fwarn-identities
227227
build-depends:
228228
Cabal
229229
, aeson
@@ -346,7 +346,7 @@ executable stack
346346
Paths_stack
347347
hs-source-dirs:
348348
src/main
349-
ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates -optP-Wno-nonportable-include-path -threaded -rtsopts
349+
ghc-options: -fwrite-ide-info -hiedir=.hie -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates -optP-Wno-nonportable-include-path -threaded -rtsopts
350350
build-depends:
351351
Cabal
352352
, aeson
@@ -468,7 +468,7 @@ executable stack-integration-test
468468
hs-source-dirs:
469469
test/integration
470470
test/integration/lib
471-
ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates -optP-Wno-nonportable-include-path -threaded -rtsopts -with-rtsopts=-N
471+
ghc-options: -fwrite-ide-info -hiedir=.hie -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates -optP-Wno-nonportable-include-path -threaded -rtsopts -with-rtsopts=-N
472472
build-depends:
473473
Cabal
474474
, aeson
@@ -597,7 +597,7 @@ test-suite stack-test
597597
Paths_stack
598598
hs-source-dirs:
599599
src/test
600-
ghc-options: -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates -optP-Wno-nonportable-include-path -threaded
600+
ghc-options: -fwrite-ide-info -hiedir=.hie -Wall -fwarn-tabs -fwarn-incomplete-uni-patterns -fwarn-incomplete-record-updates -optP-Wno-nonportable-include-path -threaded
601601
build-depends:
602602
Cabal
603603
, QuickCheck

0 commit comments

Comments
 (0)