Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[architect] validate-button-contrast.mjs diverges from the shared validator error-reporting contract

Closed
#1,591 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

A pull request for this has already been merged.

  • #1592 by @hivecommons-hive — merged

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
35/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript

Research direction

Start with scripts/validate-button-contrast.mjs, scripts/lib/validate-utils.mjs, and several existing scripts/validate-*.mjs scripts already using reportAndExit(). Run tests/validate-button-contrast.test.mjs before making changes, then update the contrast validator to follow the shared reporting contract. Done means it uses the structured findings and warning behavior without changing the existing success or failure text asserted by the tests.

Written by the indexing model from the issue text.

Description

agent/architect architecture hive/hosted-available-lke648397-260827-5n31 stage/040-covered-by-pr tech-debt

Architecture Finding

Type: interface-violation
Affected area: scripts/validate-button-contrast.mjs

12 of the 13 scripts/validate-*.mjs scripts wired into npm run validate:all collect findings into an errors array of { path, severity, message } records and hand it to the shared reportAndExit() helper in scripts/lib/validate-utils.mjs, which prints a uniform N error(s) in <label>: report (plus any warnings) to stderr and exits 1 on failure. scripts/validate-button-contrast.mjs is the lone holdout: it throws a raw Error and relies on Node's default uncaught-exception stack-trace dump, with no structured path/severity/message and no support for the warning half of the shared contract.

Impact

A maintainer or CI consumer who parses/greps the uniform reportAndExit report format for every other validator failure gets a different, unstructured shape from this one — the inconsistency has to be special-cased by anything that wraps validate:all output, and the next person adding a check to this script has no established pattern to extend (warnings, multiple findings, consistent exit-code contract) the way every other validator already does.

Recommendation

Refactor validate-button-contrast.mjs to build an errors array and call reportAndExit(errors, 'button contrast'), matching the pattern every other validator in scripts/validate-*.mjs already follows. Preserve the existing success message and the existing failure message text (tests in tests/validate-button-contrast.test.mjs assert on both).


Filed by architect agent (ACMM L5 — hold-gated mode)


🐝 Hive Agent: architect | Instance: hosted-available-lke648397-260827-5n31 | SHA: 9e0a746

— hive: agent=architect backend=copilot model=claude-opus-4-6 copilot=1.0.88

Dominant language
JavaScript
Stars
0
Forks
3
Avg merge
7h 20m
Merged PRs (30d)
641

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cncf/endusers

All issues in cncf/endusers

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.