Skip to content

[dmt] feat: add no-lang-key rule for documentation front matter#361

Merged
ipaqsa merged 1 commit into
mainfrom
feat/add-new-hugo-linter
May 15, 2026
Merged

[dmt] feat: add no-lang-key rule for documentation front matter#361
ipaqsa merged 1 commit into
mainfrom
feat/add-new-hugo-linter

Conversation

@fuldaxxx
Copy link
Copy Markdown
Member

@fuldaxxx fuldaxxx commented May 15, 2026

Description

Add a new no-lang-key rule to the documentation linter that checks markdown files in docs/ for the presence of a lang: key in YAML front matter. The rule parses the front matter block (between --- delimiters) and reports an error with the exact line number if lang: is found.

Why do we need it, and what problem does it solve?

The language of a documentation file is already determined by the file naming convention: .md for English and .ru.md for Russian. Having an additional lang: key in the YAML front matter is redundant and can lead to inconsistencies -- for example, a file named README.md (English) could have lang: ru in its front matter, or vice versa. This creates confusion for the documentation build system and for contributors.
This rule enforces a single source of truth for the document language (the file name suffix) and ensures that the lang field is removed from front matter across all module documentation.

Example

🐒 [no-lang-key (#documentation)]
     Message:      Documentation contains 'lang' key in front matter; this field should be removed
     Module:       test-module-with-lang-key
     Value:        Line 3: front matter contains 'lang' key which should be removed
     FilePath:     docs/CONFIGURATION.ru.md
🐒 [no-lang-key (#documentation)]
     Message:      Documentation contains 'lang' key in front matter; this field should be removed
     Module:       test-module-with-lang-key
     Value:        Line 3: front matter contains 'lang' key which should be removed
     FilePath:     docs/README.ru.md 

@fuldaxxx fuldaxxx self-assigned this May 15, 2026
@fuldaxxx fuldaxxx requested review from ipaqsa and ldmonster May 15, 2026 14:14
@fuldaxxx fuldaxxx changed the title [feature] add no-lang-key rule for documentation front matter [dmt] feat: add no-lang-key rule for documentation front matter May 15, 2026
@fuldaxxx fuldaxxx marked this pull request as ready for review May 15, 2026 14:30
@ipaqsa ipaqsa added enhancement New feature or request go Pull requests that update go code labels May 15, 2026
@ipaqsa ipaqsa merged commit 5e9315f into main May 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants