Skip to content

Support a generic "original" payload in structure recognizer #863

Support a generic "original" payload in structure recognizer

Support a generic "original" payload in structure recognizer #863

Triggered via pull request December 1, 2024 07:18
Status Failure
Total duration 43s
Artifacts

hlint.yml

on: pull_request
Fit to window
Zoom out
Zoom in

Annotations

1 error and 2 warnings
HLint
HLint failed with status: 1. Warning (2)
HLint: src/swarm-topography/Swarm/Game/Scenario/Topography/Structure/Recognition/Tracking.hs#L72
Warning in entityModified in module Swarm.Game.Scenario.Topography.Structure.Recognition.Tracking: Redundant return ▫︎ Found: "do stateRevision <- case HM.lookup newEntity entLookup of\n Nothing -> return oldRecognitionState\n Just finder\n -> do tell . pure . FoundParticipatingEntity\n $ ParticipatingEntity newEntity (finder ^. inspectionOffsets)\n registerRowMatches entLoader cLoc finder oldRecognitionState\n return stateRevision" ▫︎ Perhaps: "do case HM.lookup newEntity entLookup of\n Nothing -> return oldRecognitionState\n Just finder\n -> do tell . pure . FoundParticipatingEntity\n $ ParticipatingEntity newEntity (finder ^. inspectionOffsets)\n registerRowMatches entLoader cLoc finder oldRecognitionState"
HLint: src/swarm-topography/Swarm/Game/Scenario/Topography/Structure/Recognition/Tracking.hs#L86
Warning in entityModified in module Swarm.Game.Scenario.Topography.Structure.Recognition.Tracking: Redundant return ▫︎ Found: "do stateRevision <- case\n M.lookup cLoc $ foundByLocation structureRegistry\n of\n Nothing -> return oldRecognitionState\n Just fs\n -> do tell $ pure $ StructureRemoved structureName\n return\n $ oldRecognitionState & foundStructures %~ removeStructure fs\n where\n structureName = getName $ originalDefinition $ structureWithGrid fs\n return stateRevision" ▫︎ Perhaps: "do case M.lookup cLoc $ foundByLocation structureRegistry of\n Nothing -> return oldRecognitionState\n Just fs\n -> do tell $ pure $ StructureRemoved structureName\n return\n $ oldRecognitionState & foundStructures %~ removeStructure fs\n where\n structureName = getName $ originalDefinition $ structureWithGrid fs"