From 8c7638412d1e27128391b876991612b0178a101f Mon Sep 17 00:00:00 2001 From: Mike Pilgrem Date: Mon, 30 Oct 2023 21:50:26 +0000 Subject: [PATCH] Add .stan.toml specific to Pantry --- .stan.toml | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .stan.toml diff --git a/.stan.toml b/.stan.toml new file mode 100644 index 00000000..1eaa5a9b --- /dev/null +++ b/.stan.toml @@ -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"