Skip to content

Commit 03f535a

Browse files
committed
Disable fourmolu in a file with tricky CPP
1 parent 1efcc78 commit 03f535a

File tree

1 file changed

+10
-4
lines changed
  • ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ImmutableDB/Chunks

1 file changed

+10
-4
lines changed

ouroboros-consensus/src/ouroboros-consensus/Ouroboros/Consensus/Storage/ImmutableDB/Chunks/Internal.hs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ import GHC.Generics (Generic)
4949
import NoThunks.Class (NoThunks)
5050
import Ouroboros.Consensus.Block
5151
import Ouroboros.Consensus.Util.CallStack
52-
import Ouroboros.Consensus.Util.RedundantConstraints
52+
import Ouroboros.Consensus.Util.RedundantConstraints (keepRedundantConstraint)
5353

5454
-- | Size of the chunks of the immutable DB
5555
--
@@ -251,35 +251,41 @@ data ChunkAssertionFailure
251251

252252
instance Exception ChunkAssertionFailure
253253

254+
{- FOURMOLU_DISABLE -}
254255
assertSameChunk :: HasCallStack => ChunkNo -> ChunkNo -> a -> a
255256
#if ENABLE_ASSERTIONS
256257
assertSameChunk a b
257258
| a == b = id
258259
| otherwise = throw $ NotSameChunk a b prettyCallStack
259260
#else
260261
assertSameChunk _ _ = id
262+
#endif
261263
where
262264
_ = keepRedundantConstraint (Proxy @HasCallStack)
263-
#endif
265+
{- FOURMOLU_ENABLE -}
264266

267+
{- FOURMOLU_DISABLE -}
265268
assertWithinBounds :: HasCallStack => Word64 -> ChunkSize -> a -> a
266269
#if ENABLE_ASSERTIONS
267270
assertWithinBounds ix sz
268271
| ix <= maxRelativeIndex sz = id
269272
| otherwise = throw $ NotWithinBounds ix sz prettyCallStack
270273
#else
271274
assertWithinBounds _ _ = id
275+
#endif
272276
where
273277
_ = keepRedundantConstraint (Proxy @HasCallStack)
274-
#endif
278+
{- FOURMOLU_ENABLE -}
275279

280+
{- FOURMOLU_DISABLE -}
276281
assertChunkCanContainEBB :: HasCallStack => ChunkNo -> ChunkSize -> a -> a
277282
#if ENABLE_ASSERTIONS
278283
assertChunkCanContainEBB chunk size
279284
| chunkCanContainEBB size = id
280285
| otherwise = throw $ ChunkCannotContainEBBs chunk prettyCallStack
281286
#else
282287
assertChunkCanContainEBB _ _ = id
288+
#endif
283289
where
284290
_ = keepRedundantConstraint (Proxy @HasCallStack)
285-
#endif
291+
{- FOURMOLU_ENABLE -}

0 commit comments

Comments
 (0)