Skip to content

Satisfy the attgo struct field order and comment capitalisation rules - #421

Open
AntiD2ta wants to merge 4 commits into
gloas-epbs-proposerfrom
lint-attgo-cosmetic-sweep
Open

Satisfy the attgo struct field order and comment capitalisation rules#421
AntiD2ta wants to merge 4 commits into
gloas-epbs-proposerfrom
lint-attgo-cosmetic-sweep

Conversation

@AntiD2ta

Copy link
Copy Markdown
Contributor

Stacked on #420 (gloas-epbs-proposer), so this diff is the sweep alone. Retarget to gloas once #420 merges.

Pure style; no functional change. A full ./custom-gcl run goes from 108 findings to 12.

What changed

Rule Before After Action
attgo_struct_field_order 85 0 Reordered 39 structs across 38 files
attgo_capital_comment 20 9 Capitalised the 11 that are ordinary prose
attgo_no_pkg_logger 3 3 Out of scope, see below

Copyright headers on the touched files were bumped, as attgo_current_year requires.

Why 12 remain

Nine attgo_capital_comment findings are left deliberately, because satisfying them would do harm:

  • // skipcq: ... (3) and //revive:disable:nolint (3) are directives addressed to other tools. Capitalising them stops those tools recognising them, silently re-enabling whatever they suppress.
  • // attest carries out... and // sign signs... document the unexported funcs attest and sign. A Go doc comment opens with the name of the thing it documents, so capitalising would assert an exported Attest/Sign that does not exist. The rule has an identifier exemption but it matches on a fixed list of following words, which carries and signs are not in.
  • One is commented-out code.

The three attgo_no_pkg_logger findings (logging.go, services/metrics/prometheus, services/signer/standard) are a change to how vouch does logging rather than how it is formatted, so they are not folded into a formatting sweep.

Verification

  • The field reordering is a pure permutation: for all 45 changed files, the multiset of source lines is unchanged apart from the copyright headers and the 11 capitalised comments. Checked mechanically, not by eye.
  • go build ./... clean.
  • gosilent test ./... 896 tests pass.
  • Field ordering follows the linter's own categorisation (logger, metrics, dependency, data, synchronization), applied as a stable sort so relative order within a category is preserved.

Note

These findings all pre-date the Gloas work. Measured against origin/gloas, #420 introduces zero new lint findings and removes four.

@AntiD2ta AntiD2ta self-assigned this Aug 18, 2026
The attgo linter's struct field order rule groups fields as logger,
metrics, dependency, data, synchronization, and its capital comment rule
expects prose comments to start with a capital letter. Neither held
anywhere in the tree, between them accounting for 105 of the 108
findings a full run reports.

Reorder the fields of the 39 affected structs, capitalise the 11
comments that are ordinary prose, and bring the copyright headers of the
touched files up to date as attgo_current_year requires. The reordering
is a pure permutation of existing declarations, verified line by line:
no field, type or tag changed.

Nine capital comment findings are deliberately left alone, because
satisfying them would do harm:

- "skipcq:" (three) and "revive:disable:nolint" (three) are directives
  addressed to other tools, which stop being recognised if capitalised.
- "attest carries out..." and "sign signs..." document the unexported
  funcs attest and sign, and a Go doc comment opens with the name of the
  thing it documents. The rule's own identifier exemption misses these
  only because it matches on a fixed list of following words.
- One is commented-out code.

The three attgo_no_pkg_logger findings are also left: moving the
package-level loggers into struct fields changes how vouch does logging
rather than how it is formatted.

Findings drop from 108 to 12. No functional change.
@AntiD2ta
AntiD2ta force-pushed the lint-attgo-cosmetic-sweep branch from 79857e3 to 546215c Compare August 21, 2026 09:14
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