Repository navigation
Conversation
Add internal/commits with pure Normalize/validate functions enforcing the project's Conventional Commits rules (known type set, lowercase type, lowercase subject, 72-char subject limit, whitespace trimming, and 72-column body wrapping). Wire it into the CLI as 'nightshift commit normalize' (positional, --file, and stdin sources; --check to validate only), ship a commit-msg git hook under scripts/, and document the format and installation in docs/commit-messages.md. Nightshift-Task: commit-normalize Nightshift-Ref: https://github.com/marcus/nightshift
- errcheck: handle fmt.Fprintln error in commit-normalize RunE - govet: replace deprecated reflect.Ptr alias with reflect.Pointer Nightshift-Task: lint-fix Nightshift-Ref: https://github.com/marcus/nightshift
The commit-msg hook docs and hook header instruct users to run 'make install-hooks', but the target only installed the pre-commit hook. Also symlink scripts/commit-msg.sh so the documented command actually installs it. Nightshift-Task: commit-normalize Nightshift-Ref: https://github.com/marcus/nightshift
…and hook - commit-msg hook: disable errexit around the normalizer invocation so a failing command substitution no longer aborts the script before the error guidance runs; bad messages now print the expected format and exit 1 instead of failing silently. Also fix the quoted multi-word 'go run' fallback and use a mktemp error file. - commit normalize --check: actually validate instead of duplicating the rewrite path; exits non-zero (silently on success) when the message is invalid or not already in canonical form. - normalizer: accept and preserve the Conventional Commits '!' breaking change marker (feat! / feat(scope)!), lowercase the scope, and keep bullet-list body items on their own lines instead of merging them into prose; wrapped bullet continuation lines keep normalization idempotent. - CLI: drop the manual stderr print so errors are reported once by cobra, and silence the usage dump for runtime validation errors. - docs/tests updated to match; new table cases for '!', bullet lists, idempotency, and CLI-level tests for input resolution and canonicality. Nightshift-Task: commit-normalize Nightshift-Ref: https://github.com/marcus/nightshift
Fixes the full extended-lint issue set and adds .golangci.yml so 'make lint' keeps guarding revive, gocritic, misspell, unconvert, whitespace, and unparam on top of the standard linters. - rewrite if-else chains as switches (daemon, run, setup, snapshot, stats, report, preview_output, scheduler, calibrator) - reformat Deprecated: notices into dedicated paragraphs (budget, scheduler) - rename unused parameters to _ across commands, providers, integrations, tests, and mocks - add/repair exported and package doc comments (agents, providers, integrations, logging, orchestrator, security, setup, tasks, provider-calibration); justify the sqlite blank import - stop shadowing min/max/real builtins (task, tasks, selector, setup) - rename stuttering types: stats.StatsResult -> stats.Result, budget.BudgetEstimate -> budget.Estimate, budget.BudgetSource -> budget.Source - inline always-constant params (agents.truncate, orchestrator.truncateStr, db assertRowCount); the two remaining stubs (Orchestrator.commit, parseRunReportMarkdown) keep their future-proof signatures via targeted unparam exclusions Behavior-preserving only; verified with go build, go vet, gofmt, make test, and a clean golangci-lint run. Nightshift-Task: lint-fix Nightshift-Ref: https://github.com/marcus/nightshift
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the complete extended golangci-lint issue set and adds a
.golangci.ymlsomake lintkeeps guarding the extended rules going forward. All changes are behavior-preserving.The initial baseline reported 59 issues (revive 48, gocritic 6, unparam 5); once stale lint caches invalidated, the true total including downstream findings was ~90, all fixed here except two deliberately excluded stubs (see below).
Fixes by category
gocritic (if-else chains → switches) —
daemon,run,setup,snapshot,stats,report,preview_outputcommands plusschedulerandcalibrator.gocritic (Deprecated: notices) — reformatted into dedicated paragraphs in
budgetandscheduler; the twoOrchestratorusages of the deprecatedbudget.Trackercarry targeted//nolint:staticcheckwith reasons.revive unused-parameter — renamed to
_across cobraRunEhandlers, providerExecutestubs, integration readers, queueAdd, and test mocks.revive exported/package comments — added block doc comments to exported const groups (
integrations,orchestrator,security,setup,tasks); fixedError/OperationTypecomment forms (logging,security); normalized package comments toPackage X ...form (agents,providers,provider-calibration); justified the sqlite blank import indb.revive redefines-builtin-id — renamed local
min/max/realshadows (task,tasks,selector,setup).revive stutter —
stats.StatsResult→stats.Result,budget.BudgetEstimate→budget.Estimate,budget.BudgetSource→budget.Source(all call sites updated).unparam — inlined always-constant params (
agents.truncatemaxLen=2000,orchestrator.truncateStrmaxLen=1000,dbassertRowCountexpected=1). TheOrchestrator.commitandparseRunReportMarkdownstubs keep their future-proof signatures; both are covered by narrowly scopedunparamexclusions documented in.golangci.yml.New
.golangci.ymlEnables
revive,gocritic,misspell,unconvert,whitespace, andunparamon top of the standard linter set, with the two documented stub exclusions above.Verification
go build ./...✅go vet ./...✅gofmt -l .clean ✅make test— all packages pass ✅golangci-lint run(new config) — 0 issues ✅Nightshift-Task: lint-fix
Nightshift-Ref: https://github.com/marcus/nightshift
Automated by nightshift