-
Notifications
You must be signed in to change notification settings - Fork 843
/
.stan.toml
228 lines (204 loc) · 6.52 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
# Partial: base/head
# Usage of partial function 'head' for lists
[[ignore]]
id = "OBS-STAN-0001-1XF2BN-45:1"
# ✦ Category: #Partial #List
# ✦ File: src\Stack\Storage\Project.hs
#
# 45 ┃ 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-524:30"
# ✦ Category: #Infinite #List
# ✦ File: src\Stack\New.hs
#
# 523 ┃
# 524 ┃ let isPkgSpec f = ".cabal" `L.isSuffixOf` f || "package.yaml" `L.isSuffixOf` f
# 525 ┃ ^^^^^^^^^^^^^^
# Infinite: base/isSuffixOf
# Usage of the 'isSuffixOf' function that hangs on infinite lists
[[ignore]]
id = "OBS-STAN-0102-luLR/n-524:65"
# ✦ Category: #Infinite #List
# ✦ File: src\Stack\New.hs
#
# 523 ┃
# 524 ┃ let isPkgSpec f = ".cabal" `L.isSuffixOf` f || "package.yaml" `L.isSuffixOf` f
# 525 ┃ ^^^^^^^^^^^^^^
# 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-1042:3"
# ✦ Description: Usage of 'pack' function that doesn't handle Unicode characters
# ✦ Category: #AntiPattern
# ✦ File: src\Stack\Build\ExecuteEnv.hs
#
# 1041 ┃
# 1042 ┃ S8.pack . formatTime defaultTimeLocale "%Y-%m-%dT%H:%M:%S%6Q"
# 1043 ┃ ^^^^^^^
# Anti-pattern: Data.ByteString.Char8.pack
[[ignore]]
id = "OBS-STAN-0203-tuE+RG-229:21"
# ✦ Description: Usage of 'pack' function that doesn't handle Unicode characters
# ✦ Category: #AntiPattern
# ✦ File: src\Stack\Build\ExecutePackage.hs
#
# 228 ┃
# 229 ┃ newProjectRoot <- S8.pack . toFilePath <$> view projectRootL
# 230 ┃ ^^^^^^^
# Anti-pattern: Data.ByteString.Char8.pack
[[ignore]]
id = "OBS-STAN-0203-hTeu0Y-382:17"
# ✦ Description: Usage of 'pack' function that doesn't handle Unicode characters
# ✦ Category: #AntiPattern
# ✦ File: src\Stack\Init.hs
#
# 381 ┃
# 382 ┃ commentHelp = BC.pack . intercalate "\n" . map commentLine
# 383 ┃ ^^^^^^^
# Anti-pattern: Data.ByteString.Char8.pack
[[ignore]]
id = "OBS-STAN-0203-hTeu0Y-399:26"
# ✦ Description: Usage of 'pack' function that doesn't handle Unicode characters
# ✦ Category: #AntiPattern
# ✦ File: src\Stack\Init.hs
#
# 398 ┃
# 399 ┃ <> B.byteString (BC.pack $ concat
# 400 ┃ ^^^^^^^
# Anti-pattern: Data.ByteString.Char8.pack
[[ignore]]
id = "OBS-STAN-0203-axv1UG-354:32"
# ✦ Description: Usage of 'pack' function that doesn't handle Unicode characters
# ✦ Category: #AntiPattern
# ✦ File: src\Stack\Docker.hs
#
# 353 ┃
# 354 ┃ hashRepoName = Hash.hash . BS.pack . takeWhile (\c -> c /= ':' && c /= '@')
# 355 ┃ ^^^^^^^
# 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-482:33"
# ✦ Description: Usage of unsafe functions breaks referential transparency
# ✦ Category: #Unsafe #AntiPattern
# ✦ File: src\Stack\Constants.hs
#
# 481 ┃
# 482 ┃ setupGhciShimCode = byteString $(do
# 483 ┃ path <- makeRelativeToProject "src/setup-shim/StackSetupShim.hs"
# 484 ┃ embedFile path)
# 485 ┃
# Anti-pattern: unsafe functions
[[ignore]]
id = "OBS-STAN-0212-FNS1cF-56:17"
# ✦ Description: Usage of unsafe functions breaks referential transparency
# ✦ Category: #Unsafe #AntiPattern
# ✦ File: src\Stack\BuildOpts.hs
#
# 55 ┃
# 56 ┃ buildMonoid = undefined :: BuildOptsMonoid
# 57 ┃ ^^^^^^^^^
# Anti-pattern: unsafe functions
[[ignore]]
id = "OBS-STAN-0212-FNS1cF-68:14"
# ✦ Description: Usage of unsafe functions breaks referential transparency
# ✦ Category: #Unsafe #AntiPattern
# ✦ File: src\Stack\BuildOpts.hs
#
# 67 ┃
# 68 ┃ toMonoid = undefined :: TestOptsMonoid
# 69 ┃ ^^^^^^^^^
# 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"