fix(yfmlint): keep error level after double normalization #5243#2071
Open
kadymov wants to merge 1 commit into
Open
fix(yfmlint): keep error level after double normalization #5243#2071kadymov wants to merge 1 commit into
kadymov wants to merge 1 commit into
Conversation
kadymov
requested review from
HelenVirtanen and
stenin-nikita
and removed request for
a team
July 14, 2026 11:45
goldserg
approved these changes
Jul 14, 2026
kadymov
force-pushed
the
fix-lint-loglevel-degradation
branch
from
July 14, 2026 15:27
e957fab to
5bc1f54
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
The basic logic and fixes are here: diplodoc-platform/yfmlint#73
Problem
fixes #5243
Standard markdownlint rules (MD010, MD018, etc.) configured as
errorin.yfmlintwere silently downgraded towarn. As a result, the build kept passing when it should have failed — the violations were only written to the log at WARN level.Root cause
The lint config is normalized twice by two independent layers:
Lintfeature expands thelog-levelssection, merges it with the config, and callsnormalizeConfig(needed to supportlog-levelsand to appendMD033).yfmlintpackage — being a self-contained library, it callsnormalizeConfigagain when merging with its default config.normalizeConfigwas not idempotent: when processing the object form of a rule, the level was read only from the.levelfield. An already-normalized object{loglevel: 'error'}has no.level, so the fallback to the defaultwarnkicked in and the originalerrorwas lost.Fix
Added a fallback to the already-present
loglevelfield in the object-normalization branch:Re-running normalization on an already-normalized config now yields the same result, and the
errorlevel is preserved. Neither of the twonormalizeConfigcalls had to be removed — both are required for the respective layers to work correctly.Related issue: #5243