Skip to content

The server doesn't read CCHK_* environment variables #49

Open

Description

@invictustitan2

From commit-check#727, where you asked for this one to be opened here.

What happens

The CLI reads its settings from four places, and an environment variable beats the file (Configuration). The server's _merge_config (server.py:300-319 at f8feca9) reads three: the defaults, the repository's cchk.toml, and the config argument. It never reads CCHK_*.

Measured on 20 November with commit-check at 029bf06 and this repository at f8feca9, its head today, with CCHK_SUBJECT_MAX_LENGTH=10 set and the message feat: a subject longer than ten:

Result
commit-check --message exit 1, ✖ CC004 subject-max-length failed
validate_commit_message pass, with CC004 pass

The only commit-check commit since, #724, changes how revert subjects are judged, which doesn't affect this message or how config is merged.

So with a CCHK_* variable in the environment the hook runs in, the MCP guide's "an agent that passes here passes there" doesn't hold. Nothing in the result says the variable was left out, and an invalid CCHK_* value gets no notice either, since the server never reads one.

Questions for you

  1. Read them or not. Should the server apply CCHK_* the way the CLI does: above the file, with the config argument on top where the CLI has its flags? Or should it leave them out on purpose, because an agent's environment isn't the hook's or CI's, and say so in the guide?
  2. If it reads them, through commit-check's own ConfigMerger.parse_env_vars(), so the mapping stays in one place? describe_validation_rules would then show the values in force.

Once commit-check#727's notices are in, an invalid value would reach the result the same way it would from the CLI.

Activity

  1. added
    good first issue
    help wanted
    on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issuehelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions