feat(suppressor): support fragjan_suppress frontmatter field in Markdown files #27

Open
opened 2026-05-25 04:49:41 +02:00 by michael · 0 comments
Owner

Goal

Support inline rule suppression in Markdown articles via frontmatter field.

Hugo removes unknown frontmatter fields before rendering -- nothing leaks to the website.

Syntax

---
title: "My Article"
author: michael
fragjan_suppress:
  - frontmatter-author
  - frontmatter-tags
---

Background

_index.md section files often lack fields like author or tags by design.
Rather than excluding them globally (which would hide real errors), each file
can suppress specific rules with an explicit reason documented in the frontmatter.

Implementation

Two parts:

1. markdown primitive -- fragjan_suppress already extractable via
extract = "frontmatter_field", field = "fragjan_suppress" -- returns list.

2. core/suppressor.lua -- add markdown suppression path:

  • detect .md files
  • parse frontmatter, read fragjan_suppress list
  • build suppression map from rule_ids
  • integrate into runner suppression flow (parallel to inline comment suppression)

Acceptance criteria

  • fragjan_suppress list extracted correctly from frontmatter
  • Suppressed rules appear as suppressed in summary
  • Non-suppressed rules in same file still fire normally
  • Tests in test/
## Goal Support inline rule suppression in Markdown articles via frontmatter field. Hugo removes unknown frontmatter fields before rendering -- nothing leaks to the website. ## Syntax ```yaml --- title: "My Article" author: michael fragjan_suppress: - frontmatter-author - frontmatter-tags --- ``` ## Background `_index.md` section files often lack fields like `author` or `tags` by design. Rather than excluding them globally (which would hide real errors), each file can suppress specific rules with an explicit reason documented in the frontmatter. ## Implementation Two parts: **1. markdown primitive** -- `fragjan_suppress` already extractable via `extract = "frontmatter_field", field = "fragjan_suppress"` -- returns list. **2. core/suppressor.lua** -- add markdown suppression path: - detect `.md` files - parse frontmatter, read `fragjan_suppress` list - build suppression map from rule_ids - integrate into runner suppression flow (parallel to inline comment suppression) ## Acceptance criteria - [ ] `fragjan_suppress` list extracted correctly from frontmatter - [ ] Suppressed rules appear as suppressed in summary - [ ] Non-suppressed rules in same file still fire normally - [ ] Tests in test/ ## Related - DAW/fragjan#15 (exclude_rules in .fragjan -- project-level, this is file-level) - DAW/fragjan#23 (markdown primitive -- required)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DAW/fragjan#27
No description provided.