Skip to content

feat: enforce env-only endpoint configuration - #1943

Merged
gerchowl merged 8 commits into
devfrom
feature/1931-env-only-lint
Oct 27, 2026
Merged

gerchowl merged 8 commits into
devfrom
feature/1931-env-only-lint

Conversation

@gerchowl

@gerchowl gerchowl commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Enforce ADR §10's env-only configuration rules with default-on hooks limited to shell, dotenv, Python, YAML, TOML and JSON. Literal endpoints and AWS credentials fail with file/line diagnostics that omit values; documentation files, variable/command/template references, empty values, reserved hosts and explicit same-line pragmas pass.

Type of Change

  • feat -- New feature
  • fix -- Bug fix
  • test -- Adding or updating tests

Modifiers

  • Breaking change (!)

Changes Made

Add the vig-utils CLI, Nix consumer/check definitions and both portable configurations. Language tags select source files; a companion filename filter includes .env and .env.* files that pre-commit does not tag. Shell/dotenv use a physical-line assignment scanner shared with the parse-failure fallback: assignment words at statement boundaries are checked, quoted echo arguments stay inert, and pragmas apply to the finding's actual line. Template expressions are references in every format and in fallback scanning. YAML compose environment lists are checked. Other parse/encoding failures emit one notice and scan line-by-line. Document pragma/path exceptions and upgrade behavior in the package README and migration guide.

Changelog Entry

Added

  • Env-only endpoint lint (#1931)
    • Enable the ADR §10 endpoint and credential assignment checks by default in
      devkit and consumer hooks.

Testing

  • Focused tests pass locally
  • Manual testing performed

uv run --with pytest-xdist pytest tests/test_hardcoded_endpoints.py -n 4 --basetemp=$HOME/.cache/devkit-pytest/1931: RED exit 1 (42 failures), GREEN exit 0 (119 passed). Failing tests were committed before implementation. Full/container/Nix-eval suites run in CI per task instructions.

Manual Testing Details

The focused suite proves correct physical line numbers (including final-line findings), correct and adjacent pragma behavior, assignment positions after separators and env, template references across all supported types, and literals elsewhere in templated files. install.sh, scripts/init.sh, guardrails.sh and diffpack.sh scan with no findings or notices. Temporary hook/scaffold probes also verified Markdown exclusion, dotenv/shebang selection, clean consumer scans and planted endpoint detection.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly
  • I have updated CHANGELOG.md in the [Unreleased] section
  • My changes generate no new warnings or errors
  • I have added tests that prove the feature works
  • New and existing relevant unit tests pass locally
  • Any dependent changes have been merged and published

Additional Notes

Independent S5 scope; no other #1908 sub-issues included.

Refs: #1931

@gerchowl
gerchowl force-pushed the feature/1931-env-only-lint branch 2 times, most recently from f45b6e4 to 7d94244 Compare October 27, 2026 10:07
@gerchowl
gerchowl force-pushed the feature/1931-env-only-lint branch from 7d94244 to c8eb7c8 Compare October 27, 2026 10:30
@gerchowl
gerchowl merged commit d4367ba into dev Oct 27, 2026
18 checks passed
@gerchowl
gerchowl deleted the feature/1931-env-only-lint branch October 27, 2026 10:52
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