-
Notifications
You must be signed in to change notification settings - Fork 841
/
.stan.toml
239 lines (214 loc) · 6.87 KB
/
.stan.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# Partial: base/head
# Usage of partial function 'head' for lists
[[ignore]]
id = "OBS-STAN-0001-1XF2BN-48:1"
# ✦ Category: #Partial #List
# ✦ File: src\Stack\Storage\Project.hs
#
# 48 ┃ share [ mkPersist sqlSettings
# Partial: base/head
# Usage of partial function 'head' for lists
[[ignore]]
id = "OBS-STAN-0001-0pmobG-87:1"
# ✦ Category: #Partial #List
# ✦ File: src\Stack\Storage\User.hs
#
# 87 ┃ share [ mkPersist sqlSettings
# Partial: base/last
# On Windows
# To exclude .stack-work\dist\<hash>\build\stack\autogen\Paths_stack.hs
[[check]]
id = "STAN-0004"
directory = ".stack-work\\dist"
type = "Exclude"
# Partial: base/last
# On Unix-like operating systems
# To exclude .stack-work/dist/<hash>/build/stack/autogen/Paths_stack.hs
[[check]]
id = "STAN-0004"
directory = ".stack-work/dist"
type = "Exclude"
# Infinite: base/reverse
# Usage of the 'reverse' function that hangs on infinite lists
# Stack uses Data.List.reverse in many places
[[check]]
id = "STAN-0101"
scope = "all"
type = "Exclude"
# Infinite: base/isSuffixOf
# Usage of the 'isSuffixOf' function that hangs on infinite lists
[[ignore]]
id = "OBS-STAN-0102-luLR/n-525:30"
# ✦ Category: #Infinite #List
# ✦ File: src\Stack\New.hs
#
# 524 ┃
# 525 ┃ let isPkgSpec f = ".cabal" `L.isSuffixOf` f || "package.yaml" `L.isSuffixOf` f
# 526 ┃ ^^^^^^^^^^^^^^
# Infinite: base/isSuffixOf
# Usage of the 'isSuffixOf' function that hangs on infinite lists
[[ignore]]
id = "OBS-STAN-0102-luLR/n-525:65"
# ✦ Category: #Infinite #List
# ✦ File: src\Stack\New.hs
#
# 524 ┃
# 525 ┃ let isPkgSpec f = ".cabal" `L.isSuffixOf` f || "package.yaml" `L.isSuffixOf` f
# 526 ┃ ^^^^^^^^^^^^^^
# Infinite: base/length
# Usage of the 'length' function that hangs on infinite lists
# Stack uses Data.List.length in many places
[[check]]
id = "STAN-0103"
scope = "all"
type = "Exclude"
# Anti-pattern: Data.ByteString.Char8.pack
[[ignore]]
id = "OBS-STAN-0203-erw24B-1031:3"
# ✦ Description: Usage of 'pack' function that doesn't handle Unicode characters
# ✦ Category: #AntiPattern
# ✦ File: src\Stack\Build\ExecuteEnv.hs
#
# 1030 ┃
# 1031 ┃ S8.pack . formatTime defaultTimeLocale "%Y-%m-%dT%H:%M:%S%6Q"
# 1032 ┃ ^^^^^^^
# Anti-pattern: Data.ByteString.Char8.pack
[[ignore]]
id = "OBS-STAN-0203-tuE+RG-236:24"
# ✦ Description: Usage of 'pack' function that doesn't handle Unicode characters
# ✦ Category: #AntiPattern
# ✦ File: src\Stack\Build\ExecutePackage.hs
#
# 235 ┃
# 236 ┃ newConfigFileRoot <- S8.pack . toFilePath <$> view configFileRootL
# 237 ┃ ^^^^^^^
# Anti-pattern: Data.ByteString.Char8.pack
[[ignore]]
id = "OBS-STAN-0203-hTeu0Y-389:17"
# ✦ Description: Usage of 'pack' function that doesn't handle Unicode characters
# ✦ Category: #AntiPattern
# ✦ File: src\Stack\Init.hs
#
# 388 ┃
# 389 ┃ commentHelp = BC.pack . intercalate "\n" . map commentLine
# 390 ┃ ^^^^^^^
# Anti-pattern: Data.ByteString.Char8.pack
[[ignore]]
id = "OBS-STAN-0203-hTeu0Y-406:26"
# ✦ Description: Usage of 'pack' function that doesn't handle Unicode characters
# ✦ Category: #AntiPattern
# ✦ File: src\Stack\Init.hs
#
# 405 ┃
# 406 ┃ <> B.byteString (BC.pack $ concat
# 407 ┃ ^^^^^^^
# Anti-pattern: Data.ByteString.Char8.pack
[[ignore]]
id = "OBS-STAN-0203-axv1UG-347:32"
# ✦ Description: Usage of 'pack' function that doesn't handle Unicode characters
# ✦ Category: #AntiPattern
# ✦ File: src\Stack\Docker.hs
#
# 346 ┃
# 347 ┃ hashRepoName = Hash.hash . BS.pack . takeWhile (\c -> c /= ':' && c /= '@')
# 348 ┃ ^^^^^^^
# Data types with non-strict fields
# Defining lazy fields in data types can lead to unexpected space leaks
# Stack uses lazy fields in many places
[[check]]
id = "STAN-0206"
scope = "all"
type = "Exclude"
# Anti-pattern: Slow 'length' for Text
# On Windows
[[check]]
id = "STAN-0208"
file = "src\\Stack\\Build\\ConstructPlan.hs"
type = "Exclude"
# Anti-pattern: Slow 'length' for Text
# On Unix-like operating systems
[[check]]
id = "STAN-0208"
file = "src/Stack/Build/ConstructPlan.hs"
type = "Exclude"
# Anti-pattern: Slow 'length' for Text
# On Windows
[[check]]
id = "STAN-0208"
file = "src\\Stack\\Build\\Execute.hs"
type = "Exclude"
# Anti-pattern: Slow 'length' for Text
# On Unix-like operating systems
[[check]]
id = "STAN-0208"
file = "src/Stack/Build/Execute.hs"
type = "Exclude"
# Anti-pattern: Slow 'length' for Text
# On Windows
[[check]]
id = "STAN-0208"
file = "src\\Stack\\PackageDump.hs"
type = "Exclude"
# Anti-pattern: Slow 'length' for Text
# On Unix-like operating systems
[[check]]
id = "STAN-0208"
file = "src/Stack/PackageDump.hs"
type = "Exclude"
# Anti-pattern: unsafe functions
[[ignore]]
id = "OBS-STAN-0212-5rtOmw-460:33"
# ✦ Description: Usage of unsafe functions breaks referential transparency
# ✦ Category: #Unsafe #AntiPattern
# ✦ File: src\Stack\Constants.hs
#
# 459 ┃
# 460 ┃ setupGhciShimCode = byteString $(do
# 461 ┃ path <- makeRelativeToProject "src/setup-shim/StackSetupShim.hs"
# 462 ┃ embedFile path)
# 463 ┃
# Anti-pattern: unsafe functions
[[ignore]]
id = "OBS-STAN-0212-FNS1cF-60:17"
# ✦ Description: Usage of unsafe functions breaks referential transparency
# ✦ Category: #Unsafe #AntiPattern
# ✦ File: src\Stack\BuildOpts.hs
#
# 59 ┃
# 60 ┃ buildMonoid = undefined :: BuildOptsMonoid
# 61 ┃ ^^^^^^^^^
# Anti-pattern: unsafe functions
[[ignore]]
id = "OBS-STAN-0212-FNS1cF-72:14"
# ✦ Description: Usage of unsafe functions breaks referential transparency
# ✦ Category: #Unsafe #AntiPattern
# ✦ File: src\Stack\BuildOpts.hs
#
# 71 ┃
# 72 ┃ toMonoid = undefined :: TestOptsMonoid
# 73 ┃ ^^^^^^^^^
# Anti-pattern: unsafe functions
[[ignore]]
id = "OBS-STAN-0212-FNS1cF-83:15"
# ✦ Description: Usage of unsafe functions breaks referential transparency
# ✦ Category: #Unsafe #AntiPattern
# ✦ File: src/Stack/BuildOpts.hs
#
# 82 ┃
# 83 ┃ beoMonoid = undefined :: BenchmarkOptsMonoid
# 84 ┃ ^^^^^^^^^
# Anti-pattern: Pattern matching on '_'
# Pattern matching on '_' for sum types can create maintainability issues
# Stack uses pattern matching on '_' in many places.
[[check]]
id = "STAN-0213"
scope = "all"
type = "Exclude"
# Big tuples
# Using tuples of big size (>= 4) can decrease code readability
# In serveral places Stack uses 4-tuples and in one place Stack uses a
# 5-tuple.
[[check]]
id = "STAN-0302"
scope = "all"
type = "Exclude"