Skip to content

Commit

Permalink
Link TODOs to Issues (#514)
Browse files Browse the repository at this point in the history
- replace `XXX` with `TODO: #<issue number>`

TODO has simply better editor support. The GitHub plugin will suggest creating an issue for TODO that does not have the issue number after it and some editors may even ask for confirmation when committing code with TODO.
  • Loading branch information
xsebek authored Jan 24, 2023
1 parent 7fd2a1c commit 2857c2d
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 8 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/check_todos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Look for TODOs
on:
push:
paths:
- '**.hs'
branches:
- main
pull_request:
paths:
- '**.hs'
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
if grep --include \*.hs -riP '(TODO|FIXME|XXX):?\s' src 2>&1 | grep -vP '#\d+'; then
echo "Please add a link to Issue, for example: TODO: #123"
exit 1
else
echo "No TODOs without links found, all good!"
fi
2 changes: 1 addition & 1 deletion src/Swarm/Game/Log.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
-- want to use special kinds of logs that will be
-- shown to the player.
--
-- TODO: Currently we abuse this system for system
-- TODO: #1039 Currently we abuse this system for system
-- logs, which is fun, but we should eventually make
-- a dedicated `SystemLogEntry` type for 'RuntimeState'
-- message queue.
Expand Down
6 changes: 3 additions & 3 deletions src/Swarm/Language/Capability.hs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ constCaps = \case
Case -> Just CSum
Fst -> Just CProd
Snd -> Just CProd
-- XXX pair syntax should require CProd too
-- TODO: #563 pair syntax (1,2,3...) should require CProd too

-- ----------------------------------------------------------------
-- Some additional straightforward ones, which however currently
Expand All @@ -259,6 +259,6 @@ constCaps = \case
Random -> Just CRandom -- randomness device (with bitcoins)?
-- ----------------------------------------------------------------
-- Some more constants which *ought* to have their own capability but
-- currently don't. TODO: #26
View -> Nothing -- XXX this should also require something.
-- currently don't.
View -> Nothing -- TODO: #17 should require equipping an antenna
Knows -> Nothing
2 changes: 1 addition & 1 deletion src/Swarm/Language/LSP.hs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ validateSwarmCode :: J.NormalizedUri -> J.TextDocumentVersion -> Text -> LspM ()
validateSwarmCode doc version content = do
-- debug $ "Validating: " <> from (show doc) <> " ( " <> content <> ")"

-- FIXME With this call to flushDiagnosticsBySource in place, the warnings
-- FIXME: #1040 With this call to flushDiagnosticsBySource in place, the warnings
-- in other buffers (editor tabs) end up getting cleared when switching between
-- (focusing on) other buffers in VS Code.
-- However, getting rid of this seems to break error highlighting.
Expand Down
3 changes: 1 addition & 2 deletions src/Swarm/TUI/Controller.hs
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,7 @@ updateAchievements = do
-- Don't save to disk unless there was a change in the attainment list.
let incrementalAchievements = wrappedGameAchievements `M.difference` oldMasterAchievementsList
unless (null incrementalAchievements) $ do
-- TODO: This is where new achievements would be displayed in
-- a popup (see #916)
-- TODO: #916 This is where new achievements would be displayed in a popup
newAchievements <- use $ uiState . uiAchievements
liftIO $ saveAchievementsInfo $ M.elems newAchievements

Expand Down
2 changes: 1 addition & 1 deletion src/Swarm/TUI/Model/StateUpdate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ startGameWithSeed userSeed siPair@(_scene, si) toRun = do
gameState . scenarios . scenarioItemByPath p . _SISingle . _2 . scenarioStatus .= InProgress t 0 0
scenarioToAppState siPair userSeed toRun

-- XXX do we need to keep an old entity map around???
-- TODO: #516 do we need to keep an old entity map around???

-- | Modify the 'AppState' appropriately when starting a new scenario.
scenarioToAppState :: (MonadIO m, MonadState AppState m) => ScenarioInfoPair -> Maybe Seed -> Maybe CodeToRun -> m ()
Expand Down

0 comments on commit 2857c2d

Please sign in to comment.