Skip to content

Enforce sprintfint in CI custom linter gates#42660

Merged
pelikhan merged 5 commits into
mainfrom
copilot/add-sprintfint-to-ci
Jul 1, 2026
Merged

Enforce sprintfint in CI custom linter gates#42660
pelikhan merged 5 commits into
mainfrom
copilot/add-sprintfint-to-ci

Conversation

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

sprintfint is production-clean under the current lint targets, but it was not part of the enforced custom analyzer set in CI. This change adds it to the CI gate so new fmt.Sprintf("%d", int) regressions are blocked.

  • CI enforcement

    • Added -sprintfint to the make golint-custom analyzer list in .github/workflows/cgo.yml.
    • Kept the default and WASM custom-linter invocations aligned so both CI paths enforce the same analyzer set.
  • Effect

    • CI now rejects new instances of:
      fmt.Sprintf("%d", n)
      when n is exactly int, steering callers toward:
      strconv.Itoa(n)
  • Scope

    • No production code conversions were needed; this is an enforcement-only workflow change.

Copilot AI and others added 3 commits July 1, 2026 06:12
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add sprintfint to CI enforce-readiness list Enforce sprintfint in CI custom linter gates Jul 1, 2026
Copilot AI requested a review from pelikhan July 1, 2026 06:23
@pelikhan pelikhan marked this pull request as ready for review July 1, 2026 06:25
Copilot AI review requested due to automatic review settings July 1, 2026 06:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request aims to enforce the existing sprintfint custom Go analyzer in CI by adding it to the make golint-custom gate in .github/workflows/cgo.yml, preventing new fmt.Sprintf("%d", int) regressions.

Changes:

  • Added -sprintfint to the production custom-linter gate in cgo.yml.
  • Kept the WASM custom-linter gate aligned with the default gate by also adding -sprintfint.
  • Included several regenerated workflow .lock.yml files (metadata/manifest changes), which appears unrelated to the stated scope.
Show a summary per file
File Description
.github/workflows/cgo.yml Adds -sprintfint to both default and WASM custom-linter CI gates.
.github/workflows/daily-geo-optimizer.lock.yml Regenerated lock file; notably changes the declared secrets list (adds GH_AW_AGENT_TOKEN).
.github/workflows/impeccable-skills-reviewer.lock.yml Regenerated lock file (metadata/engine version churn).
.github/workflows/pr-sous-chef.lock.yml Regenerated lock file (metadata churn).
.github/workflows/test-quality-sentinel.lock.yml Regenerated lock file (metadata churn).
.github/workflows/uk-ai-operational-resilience.lock.yml Regenerated lock file (metadata churn).

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 6/6 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment thread .github/workflows/cgo.yml
Comment on lines 1207 to +1211
- name: Run custom linters
run: make golint-custom LINTER_FLAGS="-errstringmatch -panicinlibrarycode -manualmutexunlock -osexitinlibrary -rawloginlib -regexpcompileinfunction -fprintlnsprintf -strconvparseignorederror -jsonmarshalignoredeerror -uncheckedtypeassertion -fmterrorfnoverbs -tolowerequalfold -httpnoctx -timeafterleak -errortypeassertion -execcommandwithoutcontext -test=false"
run: make golint-custom LINTER_FLAGS="-errstringmatch -panicinlibrarycode -manualmutexunlock -osexitinlibrary -rawloginlib -regexpcompileinfunction -fprintlnsprintf -strconvparseignorederror -jsonmarshalignoredeerror -uncheckedtypeassertion -fmterrorfnoverbs -tolowerequalfold -httpnoctx -timeafterleak -errortypeassertion -execcommandwithoutcontext -sprintfint -test=false"

- name: Run custom linters (wasm)
run: GOOS=js GOARCH=wasm make golint-custom LINTER_FLAGS="-errstringmatch -panicinlibrarycode -manualmutexunlock -osexitinlibrary -rawloginlib -regexpcompileinfunction -fprintlnsprintf -strconvparseignorederror -jsonmarshalignoredeerror -uncheckedtypeassertion -fmterrorfnoverbs -tolowerequalfold -httpnoctx -timeafterleak -errortypeassertion -execcommandwithoutcontext -test=false" LINTER_PACKAGES="./pkg/console ./pkg/parser ./pkg/styles ./pkg/tty ./pkg/workflow"
run: GOOS=js GOARCH=wasm make golint-custom LINTER_FLAGS="-errstringmatch -panicinlibrarycode -manualmutexunlock -osexitinlibrary -rawloginlib -regexpcompileinfunction -fprintlnsprintf -strconvparseignorederror -jsonmarshalignoredeerror -uncheckedtypeassertion -fmterrorfnoverbs -tolowerequalfold -httpnoctx -timeafterleak -errortypeassertion -execcommandwithoutcontext -sprintfint -test=false" LINTER_PACKAGES="./pkg/console ./pkg/parser ./pkg/styles ./pkg/tty ./pkg/workflow"
Comment on lines +1 to +2
# gh-aw-metadata: {"schema_version":"v4","frontmatter_hash":"73c82d5712efe473241f2a860e9de83fe44ea34aa1c1636b49fcba5f34887274","body_hash":"093848a589ecab6a094b64639c60583a063f1eb7afdb0459d37a587d3e61e9bc","strict":true,"agent_id":"copilot","engine_versions":{"copilot":"1.0.67","copilot-sdk":"1.0.4"}}
# gh-aw-manifest: {"version":1,"secrets":["GH_AW_AGENT_TOKEN","GH_AW_GITHUB_MCP_SERVER_TOKEN","GH_AW_GITHUB_TOKEN","GH_AW_OTEL_GRAFANA_AUTHORIZATION","GH_AW_OTEL_GRAFANA_ENDPOINT","GH_AW_OTEL_SENTRY_AUTHORIZATION","GH_AW_OTEL_SENTRY_ENDPOINT","GITHUB_TOKEN"],"actions":[{"repo":"actions/cache/restore","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/cache/save","sha":"55cc8345863c7cc4c66a329aec7e433d2d1c52a9","version":"v6.1.0"},{"repo":"actions/checkout","sha":"9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0","version":"v7.0.0"},{"repo":"actions/download-artifact","sha":"3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c","version":"v8.0.1"},{"repo":"actions/github-script","sha":"3a2844b7e9c422d3c10d287c895573f7108da1b3","version":"v9.0.0"},{"repo":"actions/setup-python","sha":"ece7cb06caefa5fff74198d8649806c4678c61a1","version":"v6.3.0"},{"repo":"actions/upload-artifact","sha":"043fb46d1a93c77aae656e7c1c64a875d1fc6a0a","version":"v7.0.1"}],"containers":[{"image":"ghcr.io/github/gh-aw-firewall/agent:0.27.16"},{"image":"ghcr.io/github/gh-aw-firewall/api-proxy:0.27.16"},{"image":"ghcr.io/github/gh-aw-firewall/cli-proxy:0.27.16"},{"image":"ghcr.io/github/gh-aw-firewall/squid:0.27.16"},{"image":"ghcr.io/github/gh-aw-mcpg:v0.3.32","digest":"sha256:63e46b56dfd70895a701b6fc6dd0189e11e2d875f327f1781e81b31848735477","pinned_image":"ghcr.io/github/gh-aw-mcpg:v0.3.32@sha256:63e46b56dfd70895a701b6fc6dd0189e11e2d875f327f1781e81b31848735477"},{"image":"ghcr.io/github/gh-aw-node","digest":"sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b","pinned_image":"ghcr.io/github/gh-aw-node@sha256:529d02eb970b1161aa25c593a9c3df57fdfad5a8add328cb3b6eccef66f3183b"},{"image":"ghcr.io/github/github-mcp-server:v1.5.0","digest":"sha256:e25564dccc9110a70a77b9df560cbde11aa392fcb5f08b9abe5c4ebc6d146ea4","pinned_image":"ghcr.io/github/github-mcp-server:v1.5.0@sha256:e25564dccc9110a70a77b9df560cbde11aa392fcb5f08b9abe5c4ebc6d146ea4"}]}
@pelikhan pelikhan merged commit 38aaae7 into main Jul 1, 2026
26 checks passed
@pelikhan pelikhan deleted the copilot/add-sprintfint-to-ci branch July 1, 2026 06:30
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Hey @copilot-swe-agent 👋 — nice, focused change to wire up the sprintfint analyzer into the CI gate. The description is clear about scope and effect, and keeping the default + WASM invocations in sync is exactly the right approach.

One checklist item to note:

  • No test files changed — the diff touches only .github/workflows/ YAML files. For a pure CI-enforcement change (no production code conversions needed, as stated in the body), this is expected and reasonable. That said, a small smoke-test or linter integration test asserting that fmt.Sprintf("%d", n) is rejected by the analyzer would make this airtight and prevent silent regressions if the flag is ever accidentally removed.

If you’d like a hand adding coverage, here’s a ready-to-use prompt:

Add a Go test file that verifies the `sprintfint` custom analyzer rejects `fmt.Sprintf("%d", n)` where `n` is of type `int`.
Place it alongside the existing custom linter tests (look for `*_test.go` files near `pkg/linters/` or wherever sprintfint is implemented).
The test should:
1. Confirm a `fmt.Sprintf("%d", intVar)` call is flagged as a diagnostic.
2. Confirm `strconv.Itoa(intVar)` produces no diagnostic.
This ensures the CI gate cannot be silently broken by future refactors.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • patchdiff.githubusercontent.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "patchdiff.githubusercontent.com"

See Network Configuration for more information.

Generated by ✅ Contribution Check · 404.4 AIC · ⌖ 20.6 AIC · ⊞ 6.3K ·

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.

sprintfint enforce-readiness: zero production violations under the default build — add to CI

3 participants