Skip to content

Commit d2b700d

Browse files
committed
chore: consolidate hlint snake_case exceptions across codebase
Removes individual per-file hlint ignore pragmas for snake_case naming and consolidates them into a single rule in the root .hlint.yaml configuration file. - Add global hlint rule to ignore "Use camelCase" warnings in test modules, that applies to Test.**, Gen.**, and Test.Hedgehog.** module patterns - Remove 12 duplicate "{- HLINT ignore "Use camelCase" -}" pragmas from test files
1 parent af2be26 commit d2b700d

File tree

13 files changed

+4
-24
lines changed

13 files changed

+4
-24
lines changed

.hlint.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
# - ignore: {name: Use let}
5858
# - ignore: {name: Use const, within: SpecialModule} # Only within certain modules
5959

60+
# Allow snake_case naming in test modules (following Haskell test property convention)
61+
- ignore: {name: Use camelCase, within: [Test.Cardano.Api.**, Test.Golden.Cardano.Api.**]}
62+
63+
- ignore: {name: Use + directly}
6064

6165
# Define some custom infix operators
6266
# - fixity: infixr 3 ~^#^~

cardano-api/gen/Test/Hedgehog/Roundtrip/CBOR.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import GHC.Stack qualified as GHC
2323
import Hedgehog qualified as H
2424
import Hedgehog.Internal.Property (failWith)
2525

26-
{- HLINT ignore "Use camelCase" -}
27-
2826
-- | Assert that CBOR serialisation and deserialisation roundtrips.
2927
trippingCbor
3028
:: ()

cardano-api/test/cardano-api-golden/Test/Golden/Cardano/Api/Script.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ import Hedgehog.Extras.Aeson
3232
import Test.Tasty (TestTree)
3333
import Test.Tasty.Hedgehog (testProperty)
3434

35-
{- HLINT ignore "Use camelCase" -}
36-
3735
exampleSimpleScriptV1_All :: SimpleScript
3836
exampleSimpleScriptV1_All =
3937
RequireAllOf

cardano-api/test/cardano-api-test/Test/Cardano/Api/Address.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import Hedgehog.Gen qualified as H
2323
import Test.Tasty (TestTree, testGroup)
2424
import Test.Tasty.Hedgehog (testProperty)
2525

26-
{- HLINT ignore "Use camelCase" -}
27-
2826
-- Address CBOR round trips
2927

3028
prop_roundtrip_shelley_address :: Property

cardano-api/test/cardano-api-test/Test/Cardano/Api/CBOR.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ import Test.Hedgehog.Roundtrip.CBOR qualified as H
4040
import Test.Tasty (TestTree, testGroup)
4141
import Test.Tasty.Hedgehog (testProperty)
4242

43-
{- HLINT ignore "Use camelCase" -}
44-
4543
-- TODO: Need to add PaymentExtendedKey roundtrip tests however
4644
-- we can't derive an Eq instance for Crypto.HD.XPrv
4745

cardano-api/test/cardano-api-test/Test/Cardano/Api/Cip129.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ import Hedgehog.Gen.QuickCheck qualified as Q
2525
import Test.Tasty (TestTree, testGroup)
2626
import Test.Tasty.Hedgehog (testProperty)
2727

28-
{- HLINT ignore "Use camelCase" -}
29-
3028
-- | Test CIP-129 encodings. Contains examples from CIP-129 and dual hash types for committee roles.
3129
-- https://github.com/cardano-foundation/CIPs/blob/master/CIP-0129/README.md#abstract
3230
prop_decode_cip129 :: Property

cardano-api/test/cardano-api-test/Test/Cardano/Api/Envelope.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import Hedgehog qualified as H
1616
import Test.Tasty (TestTree, testGroup)
1717
import Test.Tasty.Hedgehog (testProperty)
1818

19-
{- HLINT ignore "Use camelCase" -}
20-
2119
prop_roundtrip_ByronVerificationKey_envelope :: Property
2220
prop_roundtrip_ByronVerificationKey_envelope =
2321
roundtrip_VerificationKey_envelope AsByronKey

cardano-api/test/cardano-api-test/Test/Cardano/Api/Json.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import Hedgehog.Gen qualified as Gen
2121
import Test.Tasty (TestTree, testGroup)
2222
import Test.Tasty.Hedgehog (testProperty)
2323

24-
{- HLINT ignore "Use camelCase" -}
25-
2624
prop_json_roundtrip_alonzo_genesis :: Property
2725
prop_json_roundtrip_alonzo_genesis = H.property $ do
2826
genesis <- forAll genAlonzoGenesis

cardano-api/test/cardano-api-test/Test/Cardano/Api/KeysByron.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import Test.Hedgehog.Roundtrip.CBOR (trippingCbor)
1616
import Test.Tasty (TestTree, testGroup)
1717
import Test.Tasty.Hedgehog (testProperty)
1818

19-
{- HLINT ignore "Use camelCase" -}
20-
2119
prop_roundtrip_byron_key_CBOR :: Property
2220
prop_roundtrip_byron_key_CBOR = H.property $ do
2321
seed <- H.forAll $ deterministicSigningKey AsByronKey <$> Gen.genSeedForKey AsByronKey

cardano-api/test/cardano-api-test/Test/Cardano/Api/Ord.hs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import Hedgehog.Gen qualified as H
1616
import Test.Tasty (TestTree, testGroup)
1717
import Test.Tasty.Hedgehog (testProperty)
1818

19-
{- HLINT ignore "Use camelCase" -}
20-
2119
ord_distributive
2220
:: (Show a, Ord a, Ord b)
2321
=> H.Gen a -> (a -> b) -> Property

0 commit comments

Comments
 (0)