Skip to content

feat: add Go profile with fixture and smoke test#28

Merged
baskduf merged 3 commits into
baskduf:mainfrom
DoDAON:feat/go-profile
Jun 3, 2026
Merged

feat: add Go profile with fixture and smoke test#28
baskduf merged 3 commits into
baskduf:mainfrom
DoDAON:feat/go-profile

Conversation

@DoDAON
Copy link
Copy Markdown
Contributor

@DoDAON DoDAON commented Jun 3, 2026

Summary

Adds a Go stack profile and the supporting fixture and smoke test coverage
required by the profile contribution guidelines.

  • Add templates/profiles/go/README.md with conditional guidance for Go
    modules: go build, go vet, golangci-lint when configured, go test,
    generated file protection (sqlc, protoc, mockgen, templ, stringer), and
    go mod tidy / go.sum handling.
  • Add templates/profiles/go/check_harness.py that runs go build ./...,
    go vet ./..., golangci-lint run when available, go test -count=1 ./...,
    and the generic drift checks.
  • Add templates/profiles/go/gitignore.harness.txt with Go build output,
    optional vendor directory, and kit clone entries.
  • Add tests/fixtures/go-basic/ with a minimal go.mod for smoke testing.
  • Add go-basic scenario to tests/test_smoke_fixtures.py.
  • Add go to the profile choices in scripts/apply_harness.py.
  • Add vendor and vendor/ to OPTIONAL_REFERENCES in
    scripts/check_docs_drift.py and its generic template copy so Go profile
    guidance referencing the vendor directory does not trigger false positives.
  • Update docs/profiles.md and docs/validation.md to list the Go profile.

Closes #5

Test plan

  • python -m unittest discover -s tests — 117 passed, 1 skipped
  • python scripts/check_docs_drift.py — passes
  • python scripts/check_structure.py — passes
  • python scripts/check_failure_memory.py — passes
  • python scripts/check_decision_memory.py — passes

@baskduf
Copy link
Copy Markdown
Owner

baskduf commented Jun 3, 2026

This should be gated on target repository configuration, not only on whether golangci-lint happens to be installed on the machine.

The profile README says to run golangci-lint only when the target has .golangci.yml or .golangci.toml, but this script currently runs it whenever the binary exists globally. That makes the harness result depend on the reviewer/CI environment instead of target repo evidence, which conflicts with the source-of-truth rule.

Could you gate this on project config, e.g. .golangci.yml, .golangci.yaml, or .golangci.toml?

Copy link
Copy Markdown
Owner

@baskduf baskduf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the Go profile. The scope is narrow, CI is green, and the fixture/profile wiring looks mostly aligned with the profile contribution rules.

I’m requesting one small change before approval: templates/profiles/go/check_harness.py should only run golangci-lint when the target repository has a golangci-lint config. Right now it runs whenever the binary exists globally, which makes the suggested harness depend on machine environment rather than target repo configuration.

Non-blocking: README still does not show a Go profile badge/list entry even though docs/profiles.md and docs/validation.md were updated. I would prefer adding it, but the lint gating is the only blocker for me.

lint_configs = (".golangci.yml", ".golangci.yaml", ".golangci.toml")
if shutil.which("golangci-lint") and any((ROOT / name).exists() for name in lint_configs):
    run(["golangci-lint", "run"])

Gate golangci-lint execution on the presence of a project-level config
(.golangci.yml, .golangci.yaml, or .golangci.toml) so the harness
result depends on target repo evidence, not the reviewer's environment.

Also add Go profile badge to README.md shields section.
@DoDAON
Copy link
Copy Markdown
Contributor Author

DoDAON commented Jun 3, 2026

Applied both changes in a8fde7e:

  • Gated golangci-lint on the presence of .golangci.yml, .golangci.yaml, or .golangci.toml in the target repo root — binary-only check removed.
  • Added Go badge to README shields section.

@baskduf
Copy link
Copy Markdown
Owner

baskduf commented Jun 3, 2026

Thanks, the requested blocker is fixed in a8fde7e and Harness Check is green.

One small docs cleanup before approval: templates/profiles/go/README.md still says the script runs golangci-lint “when available.” Could you update that wording to match the new behavior?

Suggested wording:

It runs go vet, golangci-lint when the target has a golangci-lint config, and the generic drift checks.

Also please include .golangci.yaml in the Recommended Checks line alongside .golangci.yml and .golangci.toml.

Add .golangci.yaml to the Recommended Checks line alongside .golangci.yml
and .golangci.toml, and update the Suggested Check Script description to
reflect that golangci-lint runs only when a config file is present.
@DoDAON
Copy link
Copy Markdown
Contributor Author

DoDAON commented Jun 3, 2026

Fixed in e720c35:

  • Added .golangci.yaml to the Recommended Checks line alongside .golangci.yml and .golangci.toml.
  • Updated the Suggested Check Script description to match the config-gated behavior.

Copy link
Copy Markdown
Owner

@baskduf baskduf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good now. The lint gating is tied to target repo config, the Go profile README matches the implementation, and Harness Check is green.

Approved.

@baskduf baskduf merged commit ca367db into baskduf:main Jun 3, 2026
2 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.

Add Go profile with fixture and smoke test

2 participants