fix: resolve CI lint errors and Windows test timeout
- Fix gosec G204/G304 warnings by adding exclusions for safe subprocess launches and file reads in doctor.go, jira.go, migrate_sync.go, and syncbranch/worktree.go - Fix misspell: "cancelled" -> "canceled" in sync.go - Fix unparam: mark unused ctx params in jira.go placeholder functions - Fix errcheck: explicitly ignore fmt.Sscanf return in doctor.go and use closure pattern for deferred os.RemoveAll in worktree.go - Increase Windows test timeout from 10m to 20m to prevent CI timeouts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2515,7 +2515,7 @@ func checkSyncBranchHealth(path string) doctorCheck {
|
||||
fileCount := len(strings.Split(diffFiles, "\n"))
|
||||
// Parse ahead count as int for comparison
|
||||
aheadCountInt := 0
|
||||
fmt.Sscanf(aheadCount, "%d", &aheadCountInt)
|
||||
_, _ = fmt.Sscanf(aheadCount, "%d", &aheadCountInt)
|
||||
|
||||
// Only warn if significantly behind (20+ commits AND 50+ source files)
|
||||
// Small drift is normal between bd sync operations
|
||||
|
||||
@@ -642,7 +642,7 @@ func detectJiraConflicts(ctx context.Context) ([]JiraConflict, error) {
|
||||
// reimportConflicts re-imports conflicting issues from Jira (Jira wins).
|
||||
// NOTE: This is a placeholder - full implementation requires fetching individual
|
||||
// issues from Jira API and updating local copies.
|
||||
func reimportConflicts(ctx context.Context, conflicts []JiraConflict) error {
|
||||
func reimportConflicts(_ context.Context, conflicts []JiraConflict) error {
|
||||
if len(conflicts) == 0 {
|
||||
return nil
|
||||
}
|
||||
@@ -657,7 +657,7 @@ func reimportConflicts(ctx context.Context, conflicts []JiraConflict) error {
|
||||
// resolveConflictsByTimestamp resolves conflicts by keeping the newer version.
|
||||
// NOTE: This is a placeholder - full implementation requires fetching Jira
|
||||
// timestamps and comparing with local timestamps.
|
||||
func resolveConflictsByTimestamp(ctx context.Context, conflicts []JiraConflict) error {
|
||||
func resolveConflictsByTimestamp(_ context.Context, conflicts []JiraConflict) error {
|
||||
if len(conflicts) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -419,7 +419,7 @@ Use --merge to merge the sync branch back to main branch.`,
|
||||
fmt.Printf("✓ Pushed merged changes to %s\n", syncBranchName)
|
||||
pushedViaSyncBranch = true
|
||||
} else {
|
||||
fmt.Println("Push cancelled. Run 'bd sync' again to retry.")
|
||||
fmt.Println("Push canceled. Run 'bd sync' again to retry.")
|
||||
fmt.Println("If this was unintended, use 'git reflog' on the sync branch to recover.")
|
||||
}
|
||||
} else if pullResult.Pushed {
|
||||
|
||||
Reference in New Issue
Block a user