Skip to content

Commit

Permalink
Add .stan.toml specific to Pantry
Browse files Browse the repository at this point in the history
  • Loading branch information
mpilgrem committed Oct 30, 2023
1 parent a175162 commit 8c76384
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .stan.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Infinite: base/reverse
# Usage of the 'reverse' function that hangs on infinite lists
# Pantry uses Data.List.reverse in many places
[[check]]
id = "STAN-0101"
scope = "all"
type = "Exclude"

# Anti-pattern: Data.ByteString.Char8.pack
[[ignore]]
id = "OBS-STAN-0203-RDkR59-110:17"
# ✦ Description: Usage of 'pack' function that doesn't handle Unicode characters
# ✦ Category: #AntiPattern
# ✦ File: src/Hackage\Security\Client\Repository\HttpLib\HttpClient.hs
#
# 109 ┃
# 110 ┃ rangeHeader = BS.C8.pack $ "bytes=" ++ show from ++ "-" ++ show (to - 1)
# 111 ┃ ^^^^^^^^^^

# Data types with non-strict fields
# Defining lazy fields in data types can lead to unexpected space leaks
# Pantry uses lazy fields in many places
[[check]]
id = "STAN-0206"
scope = "all"
type = "Exclude"

# Anti-pattern: Slow 'length' for Text
[[ignore]]
id = "OBS-STAN-0208-gkCCTP-1100:14"
# ✦ Description: Usage of 'length' for 'Text' that runs in linear time
# ✦ Category: #AntiPattern
# ✦ File: src/Pantry.hs
#
# 1099 ┃
# 1100 ┃ isSHA1 t = T.length t == 40 && T.all isHexDigit t
# 1101 ┃ ^^^^^^^^

# Anti-pattern: Pattern matching on '_'
# Pattern matching on '_' for sum types can create maintainability issues
# Pantry 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 Pantry uses 4-tuples.
[[check]]
id = "STAN-0302"
scope = "all"
type = "Exclude"

0 comments on commit 8c76384

Please sign in to comment.