Skip to content

chore(lint): activity pkg doc + 56-package ST1000 sweep#69

Merged
0xmanhnv merged 3 commits into
developfrom
chore/lint-cleanup-activity-pkg-sweep
May 11, 2026
Merged

chore(lint): activity pkg doc + 56-package ST1000 sweep#69
0xmanhnv merged 3 commits into
developfrom
chore/lint-cleanup-activity-pkg-sweep

Conversation

@0xmanhnv
Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #68 (which was squash-merged before these two commits landed). Clears remaining staticcheck warnings:

  • internal/app/activity/service.go — added // Package activity ... doc comment + bulk replaced 15× interface{}any (ST1000, ST1019)
  • 56 packages — added one-line // Package <name> ... comment to one canonical file per package (preferring service.go where present) (ST1000)

5 packages had pre-existing comments with mismatched names — fixed by hand: internal/app/template/validator.go, pkg/domain/{assetgroup,scannertemplate,secretstore,templatesource}/entity.go.

Verification

  • GOWORK=off go build ./... — exit 0
  • GOWORK=off staticcheck ./... — 0 issues across the whole repo

Test plan

  • Build green
  • Staticcheck 0 issues
  • CI green

Nguyen Manh added 3 commits May 11, 2026 13:51
internal/app/activity/service.go was the only file in the activity package
and carried two distinct lint complaints:

  - ST1000: package missing godoc comment. Added one explaining the
    service's role (orchestration over the domain activity entities +
    repository for user-facing activity events).
  - 15× ST1023/gocritic: parameters typed as `interface{}` instead of
    Go 1.18+ alias `any`. Bulk-replaced; semantically identical.

Build + staticcheck clean for the package.
Staticcheck ST1000 requires every Go package to have at least one file
that opens with a "// Package <name> ..." doc comment. The codebase had
56 packages without one (a long tail accumulated over the rapid scaffold
phase). One file per package now carries a comment that briefly states
the package's purpose, derived from the path:

  - internal/app/<X>/             — application services
  - internal/infra/postgres/<X>/  — repository implementations
  - internal/infra/http/handler/  — HTTP handlers
  - internal/infra/http/middleware — request middleware
  - internal/infra/http/routes    — route registration
  - internal/infra/controller/    — background reconcilers
  - internal/infra/notification/  — multi-channel delivery
  - internal/infra/storage/       — binary blob backends
  - internal/infra/adapters/<X>/  — scanner output adapters
  - internal/config               — config loader
  - cmd/openctem-admin/cmd        — admin CLI commands
  - pkg/<X>/                      — public packages

Five packages already had a comment but with the wrong subject (referred
to a renamed type or a different package name) — fixed those by hand:

  - internal/app/template/validator.go      ("validators" → "template")
  - pkg/domain/assetgroup/entity.go         ("asset_group" → "assetgroup")
  - pkg/domain/scannertemplate/entity.go    ("scanner_template" → "scannertemplate")
  - pkg/domain/secretstore/entity.go        ("credential" → "secretstore")
  - pkg/domain/templatesource/entity.go     ("template_source" → "templatesource")

Verification: `staticcheck ./...` now reports 0 issues (was: 56 ST1000 + the
godoc-subject ones above). `go build ./...` and `go test ./tests/unit/...`
pass unchanged. No behavior change — pure docstrings.
@0xmanhnv 0xmanhnv merged commit 4830c7b into develop May 11, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant