From a28f1540c448ca06c4821b1e37502884fa772d15 Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Sat, 30 Nov 2024 08:11:51 -0600 Subject: [PATCH] Don't worry about missing pit issues if the Trello card is completed. This is a normal case when you go a really long time without syncing and the issues fall off of the pit time horizon. Also, bump versions to support Nim 2.x --- .tool-versions | 2 +- pit2trello.nimble | 8 ++++---- src/pit2trello.nim | 6 +++++- src/pit2trellopkg/cliconstants.nim | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.tool-versions b/.tool-versions index 96f95dc..fe5573e 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1 +1 @@ -nim 1.6.20 +nim 2.2.0 diff --git a/pit2trello.nimble b/pit2trello.nimble index 20a859f..c64e27d 100644 --- a/pit2trello.nimble +++ b/pit2trello.nimble @@ -1,6 +1,6 @@ # Package -version = "0.2.2" +version = "0.2.3" author = "Jonathan Bernard" description = "Synchronization tool between JDB pit and Trello." license = "MIT" @@ -19,11 +19,11 @@ requires @[ # Dependencies from git.jdb-software.com/jdb/nim-packages requires @[ - "cliutils >= 0.8.1", - "pit >= 4.23.3", + "cliutils >= 0.9.1", + "pit >= 4.26.0", "timeutils", "update_nim_package_version" ] task updateVersion, "Update the version of this package.": - exec "update_nim_package_version pit2trello 'src/pit2trellopkg/cliconstants.nim'" \ No newline at end of file + exec "update_nim_package_version pit2trello 'src/pit2trellopkg/cliconstants.nim'" diff --git a/src/pit2trello.nim b/src/pit2trello.nim index e92269a..85fcdea 100644 --- a/src/pit2trello.nim +++ b/src/pit2trello.nim @@ -192,6 +192,11 @@ proc syncContext( for (list, lentCard) in unmatchedCards: let (list, card) = (list, lentCard) + let issueState = issueStateForListCategory(list.category) + + # Don't worry about creating new issues for cards that are done. + if issueState == Done: continue + let issue = Issue( id: genUUID(), summary: card.name, @@ -205,7 +210,6 @@ proc syncContext( filter(it.isSome). map(it.get)) - let issueState = issueStateForListCategory(list.category) if not dryRun: s.pit.tasksDir.store(issue, issueState) info "pit created: " & formatSectionIssue(issue, width = 64) & " " & $issueState diff --git a/src/pit2trellopkg/cliconstants.nim b/src/pit2trellopkg/cliconstants.nim index 68d21f4..da63355 100644 --- a/src/pit2trellopkg/cliconstants.nim +++ b/src/pit2trellopkg/cliconstants.nim @@ -1,4 +1,4 @@ -const PIT2TRELLO_VERSION* = "0.2.2" +const PIT2TRELLO_VERSION* = "0.2.3" const USAGE* = """ Usage: