Skip to content

fix(mapper): honor the documented per-smell disabled override#77

Merged
devill merged 1 commit into
habit-hooks:mainfrom
LiinaSuoniemi:mapper-honor-smell-disabled
Jul 25, 2026
Merged

fix(mapper): honor the documented per-smell disabled override#77
devill merged 1 commit into
habit-hooks:mainfrom
LiinaSuoniemi:mapper-honor-smell-disabled

Conversation

@LiinaSuoniemi

Copy link
Copy Markdown
Contributor

Splitting the off-switch out of #72, as you suggested.

config.md promises [smells.<name>] disabled drops a smell, "neither coached nor counted". The mapper never reads it, so setting it does nothing. This wires it, mirroring the sensor-level disable in loader.py.

The one call I'm unsure about: disabling the only smell that fired now prints the clean pass reminder, on the theory that a disabled smell should land like a sensor that never reported. The alternative is printing nothing. It has its own spec case, so it is a one line flip if you'd rather.

run() hit 13 statements against the 12 from #74, so its stderr loop moved into write_stderr().

config.md documents `[smells.<name>] disabled` as "drop the smell, neither
coached nor counted", but the mapper never read it. It honors a smell's
`severity` and `guide` overrides only, so `disabled = true` parsed without
error and did nothing.

Filter disabled smells out before routing, mirroring the sensor-level
off-switch in sensors/loader.py. Dropping a smell now behaves the same as
dropping the sensor that reported it: nothing renders for it and it cannot
fail the run.

The filter took run() to 13 statements against this repo's own
max-statements of 12, so its stderr loop moves out into write_stderr().

@devill devill left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice split — this reads exactly like the sensor-level disable, which is what I'd hoped for.

On your open question: keep it as you have it. habit-snooze already drops a finding outright when its last issue is snoozed (docs/habit-snooze.spec.md — "A finding loses its only issue and disappears"), and the mapper then renders clean.md. So "everything suppressed → pass reminder" is the existing suppression story, not a new one. Printing nothing would leave a silent exit 0, which is worse.

Moving the stderr loop into write_stderr() is the right call too.

Verified locally merged with current main: full suite green (109 passed), ruff clean.

@devill
devill merged commit 2b34158 into habit-hooks:main Jul 25, 2026
2 checks passed
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.

2 participants