Skip to content

Preserve markdownlint directives when wrapping#130

Closed
leynos wants to merge 3 commits intomainfrom
i5c327-codex/add-test-for-markdownlint-comment-directives
Closed

Preserve markdownlint directives when wrapping#130
leynos wants to merge 3 commits intomainfrom
i5c327-codex/add-test-for-markdownlint-comment-directives

Conversation

@leynos
Copy link
Copy Markdown
Owner

@leynos leynos commented Jul 29, 2025

Summary

  • update wrap logic to keep markdownlint directives on a single line
  • cover directive behaviour with integration tests

Testing

  • make lint
  • make test

https://chatgpt.com/codex/tasks/task_e_68888eec3afc8322a17eab06cba6d228

Summary by Sourcery

Improve text wrapping to keep markdownlint directives on their own line and add tests to verify this behavior and normal comment wrapping

Enhancements:

  • Detect and preserve markdownlint directives as standalone lines during wrapping

Tests:

  • Add integration test to ensure markdownlint directives remain unwrapped
  • Add integration test to verify regular HTML comments wrap as expected

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Jul 29, 2025

Reviewer's Guide

wrap_text now treats markdownlint directives as atomic lines—flushing the current buffer and inserting directives unwrapped—and adds integration tests to verify both directive preservation and regular comment wrapping behavior.

Flow diagram for handling markdownlint directives in wrap_text

flowchart TD
    A[Start line processing] --> B{Is line a markdownlint directive?}
    B -- Yes --> C[Flush paragraph buffer]
    C --> D[Insert directive line as-is]
    D --> E[Continue to next line]
    B -- No --> F{Is line empty?}
    F -- Yes --> G[Flush paragraph buffer]
    G --> H[Continue to next line]
    F -- No --> I[Add line to buffer]
    I --> E
Loading

File-Level Changes

Change Details Files
Preserve markdownlint directives as unwrapped lines in wrap logic
  • Detect directive lines in wrap_text using trimmed.prefix("")
  • Flush current paragraph and clear buffers before pushing the directive line
  • Skip standard wrapping for detected directives
src/wrap.rs
Add tests for markdownlint directive behavior and regular comment wrapping
  • Add test_markdownlint_directive_not_broken to ensure directives remain intact
  • Add test_regular_comment_wraps_normally to verify standard comments wrap across lines
tests/wrap.rs

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 29, 2025

Summary by CodeRabbit

  • New Features
    • Markdownlint directive comments are now preserved as standalone lines during text wrapping and are not altered or wrapped.
  • Tests
    • Added tests to ensure markdownlint directive comments remain unchanged, while regular comments continue to be wrapped as usual.

Walkthrough

Introduce a new static regex and helper function to detect markdownlint directive comments within src/wrap.rs. Update the wrap_text function to preserve these directive lines verbatim, ensuring they are not wrapped or merged with other text. Add targeted tests in tests/markdownlint.rs to verify the correct handling and preservation of markdownlint directives during text wrapping.

Changes

Cohort / File(s) Change Summary
Markdownlint Directive Handling
src/wrap.rs
Add static regex and is_markdownlint_directive function; update wrap_text to preserve markdownlint directive comments as standalone lines.
Directive Preservation Tests
tests/markdownlint.rs
Introduce tests verifying markdownlint directive comments are preserved verbatim and regular comments are wrapped normally.

Sequence Diagram(s)

sequenceDiagram
    participant InputLine as Input Line
    participant WrapText as wrap_text()
    participant Output as Output

    InputLine->>WrapText: Provide next line
    alt Is markdownlint directive
        WrapText->>Output: Output line verbatim
        WrapText->>WrapText: Flush paragraph buffer
    else Is empty line
        WrapText->>Output: Output paragraph buffer
    else
        WrapText->>WrapText: Buffer line for wrapping
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

Preserve the lint with regex keen,
Directives stand tall, crisp and clean.
No wrapping here, no merge, no blend—
Markdownlint’s rules, we defend!
Through tests and code, the logic flows,
Each comment line, untouched it goes.
📝✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch i5c327-codex/add-test-for-markdownlint-comment-directives

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey @leynos - I've reviewed your changes and found some issues that need to be addressed.

  • Extract the markdownlint directive detection into a helper function or regex constant to simplify wrap_text and make it easier to extend in the future.
  • Add tests for other markdownlint directive variants (e.g. disable-line, enable) and scenarios with leading indentation to ensure all directive forms are preserved correctly.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Extract the markdownlint directive detection into a helper function or regex constant to simplify wrap_text and make it easier to extend in the future.
- Add tests for other markdownlint directive variants (e.g. disable-line, enable) and scenarios with leading indentation to ensure all directive forms are preserved correctly.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@leynos leynos force-pushed the i5c327-codex/add-test-for-markdownlint-comment-directives branch from 1c290f7 to 021fa03 Compare July 29, 2025 22:58
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 5

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1c290f7 and 021fa03.

📒 Files selected for processing (2)
  • src/wrap.rs (3 hunks)
  • tests/markdownlint.rs (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.rs

📄 CodeRabbit Inference Engine (AGENTS.md)

**/*.rs: Clippy warnings MUST be disallowed.
Fix any warnings emitted during tests in the code itself rather than silencing them.
Where a function is too long, extract meaningfully named helper functions adhering to separation of concerns and CQRS.
Where a function has too many parameters, group related parameters in meaningfully named structs.
Where a function is returning a large error consider using Arc to reduce the amount of data returned.
Write unit and behavioural tests for new functionality. Run both before and after making any change.
Every module must begin with a module level (//!) comment explaining the module's purpose and utility.
Document public APIs using Rustdoc comments (///) so documentation can be generated with cargo doc.
Prefer immutable data and avoid unnecessary mut bindings.
Handle errors with the Result type instead of panicking where feasible.
Avoid unsafe code unless absolutely necessary and document any usage clearly.
Place function attributes after doc comments.
Do not use return in single-line functions.
Use predicate functions for conditional criteria with more than two branches.
Lints must not be silenced except as a last resort.
Lint rule suppressions must be tightly scoped and include a clear reason.
Prefer expect over allow.
Prefer .expect() over .unwrap().
Use concat!() to combine long string literals rather than escaping newlines with a backslash.
Prefer semantic error enums: Derive std::error::Error (via the thiserror crate) for any condition the caller might inspect, retry, or map to an HTTP status.
Use an opaque error only at the app boundary: Use eyre::Report for human-readable logs; these should not be exposed in public APIs.
Never export the opaque type from a library: Convert to domain enums at API boundaries, and to eyre only in the main main() entrypoint or top-level async task.

Files:

  • src/wrap.rs
  • tests/markdownlint.rs

⚙️ CodeRabbit Configuration File

**/*.rs: * Seek to keep the cyclomatic complexity of functions no more than 12.

  • Adhere to single responsibility and CQRS

  • Place function attributes after doc comments.

  • Do not use return in single-line functions.

  • Move conditionals with >2 branches into a predicate function.

  • Avoid unsafe unless absolutely necessary.

  • Every module must begin with a //! doc comment that explains the module's purpose and utility.

  • Comments and docs must follow en-GB-oxendict (-ize / -our) spelling and grammar

  • Lints must not be silenced except as a last resort.

    • #[allow] is forbidden.
    • Only narrowly scoped #[expect(lint, reason = "...")] is allowed.
    • No lint groups, no blanket or file-wide suppression.
    • Include FIXME: with link if a fix is expected.
  • Use rstest fixtures for shared setup and to avoid repetition between tests.

  • Replace duplicated tests with #[rstest(...)] parameterised cases.

  • Prefer mockall for mocks/stubs.

  • Prefer .expect() over .unwrap()

  • Ensure that any API or behavioural changes are reflected in the documentation in docs/

  • Ensure that any completed roadmap steps are recorded in the appropriate roadmap in docs/

  • Files must not exceed 400 lines in length

    • Large modules must be decomposed
    • Long match statements or dispatch tables should be decomposed by domain and collocated with targets
    • Large blocks of inline data (e.g., test fixtures, constants or templates) must be moved to external files and inlined at compile-time or loaded at run-time.

Files:

  • src/wrap.rs
  • tests/markdownlint.rs
🔇 Additional comments (3)
tests/markdownlint.rs (3)

1-6: LGTM! Excellent module documentation.

The module documentation clearly explains the purpose and includes specific examples of the functionality being tested.


24-44: LGTM! Comprehensive test for regular comment wrapping.

This test effectively demonstrates that the markdownlint directive detection doesn't interfere with normal comment processing, ensuring the feature is correctly scoped.


13-22: Confirm markdownlint directive preservation.
The MARKDOWNLINT_DIRECTIVE_RE correctly matches the trimmed <!-- markdownlint-disable-next-line MD013 --> line, and wrap_text flushes the preceding paragraph then emits the directive unchanged. The test’s assert_eq!(output, input) is valid—no change required.

Comment thread src/wrap.rs
Comment on lines +21 to +25
/// Matches markdownlint directives including `disable`, `enable`,
/// `disable-line` and `disable-next-line` forms.
static MARKDOWNLINT_DIRECTIVE_RE: std::sync::LazyLock<Regex> = std::sync::LazyLock::new(|| {
Regex::new(r"^<!--\s*markdownlint-[^>]*-->$").expect("valid markdownlint regex")
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Improve regex pattern specificity and documentation.

The current regex ^<!--\s*markdownlint-[^>]*-->$ is too permissive and could match unintended content. It allows any characters after markdownlint- until the closing -->, potentially matching malformed directives.

Replace with a more specific pattern that matches the actual markdownlint directive syntax:

-/// Matches markdownlint directives including `disable`, `enable`,
-/// `disable-line` and `disable-next-line` forms.
-static MARKDOWNLINT_DIRECTIVE_RE: std::sync::LazyLock<Regex> = std::sync::LazyLock::new(|| {
-    Regex::new(r"^<!--\s*markdownlint-[^>]*-->$").expect("valid markdownlint regex")
-});
+/// Matches markdownlint directives including `disable`, `enable`,
+/// `disable-line` and `disable-next-line` forms with optional rule names.
+static MARKDOWNLINT_DIRECTIVE_RE: std::sync::LazyLock<Regex> = std::sync::LazyLock::new(|| {
+    Regex::new(r"^\s*<!--\s*markdownlint-(?:disable|enable|disable-line|disable-next-line)(?:\s+[A-Z0-9\s]+)?\s*-->\s*$")
+        .expect("valid markdownlint regex")
+});
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/// Matches markdownlint directives including `disable`, `enable`,
/// `disable-line` and `disable-next-line` forms.
static MARKDOWNLINT_DIRECTIVE_RE: std::sync::LazyLock<Regex> = std::sync::LazyLock::new(|| {
Regex::new(r"^<!--\s*markdownlint-[^>]*-->$").expect("valid markdownlint regex")
});
/// Matches markdownlint directives including `disable`, `enable`,
/// `disable-line` and `disable-next-line` forms with optional rule names.
static MARKDOWNLINT_DIRECTIVE_RE: std::sync::LazyLock<Regex> = std::sync::LazyLock::new(|| {
Regex::new(r"^\s*<!--\s*markdownlint-(?:disable|enable|disable-line|disable-next-line)(?:\s+[A-Z0-9\s]+)?\s*-->\s*$")
.expect("valid markdownlint regex")
});
🤖 Prompt for AI Agents
In src/wrap.rs around lines 21 to 25, the regex pattern for matching
markdownlint directives is too broad and may match unintended content. Refine
the regex to specifically match valid markdownlint directives such as `disable`,
`enable`, `disable-line`, and `disable-next-line` with optional rule names,
ensuring it does not allow arbitrary characters. Update the regex pattern and
improve the comment to clearly describe the exact directive forms it matches.

Comment thread src/wrap.rs
Comment on lines +302 to +305
#[doc(hidden)]
pub fn is_markdownlint_directive(line: &str) -> bool {
MARKDOWNLINT_DIRECTIVE_RE.is_match(line.trim())
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Remove unnecessary #[doc(hidden)] attribute.

The #[doc(hidden)] attribute is inappropriate for a function that appears to be part of the module's intended functionality. Based on the test file, this function serves a legitimate purpose in the public API.

Apply this diff to make the function properly documented:

-#[doc(hidden)]
-pub fn is_markdownlint_directive(line: &str) -> bool {
-    MARKDOWNLINT_DIRECTIVE_RE.is_match(line.trim())
-}
+/// Check if a line contains a markdownlint directive comment.
+///
+/// Returns `true` for comments matching markdownlint directive patterns
+/// such as `<!-- markdownlint-disable-next-line -->`.
+pub fn is_markdownlint_directive(line: &str) -> bool {
+    MARKDOWNLINT_DIRECTIVE_RE.is_match(line.trim())
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#[doc(hidden)]
pub fn is_markdownlint_directive(line: &str) -> bool {
MARKDOWNLINT_DIRECTIVE_RE.is_match(line.trim())
}
/// Check if a line contains a markdownlint directive comment.
///
/// Returns `true` for comments matching markdownlint directive patterns
/// such as `<!-- markdownlint-disable-next-line -->`.
pub fn is_markdownlint_directive(line: &str) -> bool {
MARKDOWNLINT_DIRECTIVE_RE.is_match(line.trim())
}
🤖 Prompt for AI Agents
In src/wrap.rs around lines 302 to 305, remove the #[doc(hidden)] attribute from
the is_markdownlint_directive function to ensure it is properly documented and
visible as part of the module's public API.

Comment thread src/wrap.rs
Comment on lines +422 to +428
if is_markdownlint_directive(line) {
flush_paragraph(&mut out, &buf, &indent, width);
buf.clear();
indent.clear();
out.push(line.clone());
continue;
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Consolidate markdownlint directive handling with existing special case logic.

The markdownlint directive handling duplicates code patterns already present for other special cases (fences, tables, headers). This creates maintenance burden and inconsistency.

Move the markdownlint directive check earlier in the function to group it with other special cases:

         }

+        if is_markdownlint_directive(line) {
+            flush_paragraph(&mut out, &buf, &indent, width);
+            buf.clear();
+            indent.clear();
+            out.push(line.clone());
+            continue;
+        }
+
         if line.trim_start().starts_with('#') {
             flush_paragraph(&mut out, &buf, &indent, width);
             buf.clear();
             indent.clear();
             out.push(line.clone());
             continue;
         }

-        if is_markdownlint_directive(line) {
-            flush_paragraph(&mut out, &buf, &indent, width);
-            buf.clear();
-            indent.clear();
-            out.push(line.clone());
-            continue;
-        }
-
         let trimmed = line.trim();
🤖 Prompt for AI Agents
In src/wrap.rs around lines 422 to 428, the handling of markdownlint directives
duplicates code already used for other special cases like fences, tables, and
headers. To fix this, move the markdownlint directive check earlier in the
function so it is grouped with the other special case checks. This consolidation
will reduce code duplication and improve maintainability by handling all special
cases in a single, consistent block.

Comment thread src/wrap.rs
Comment on lines +430 to +431
let trimmed = line.trim();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Remove redundant variable assignment.

The trimmed variable is assigned but only used once immediately after, creating unnecessary complexity.

Inline the trim() call:

-        let trimmed = line.trim();
-
-        if trimmed.is_empty() {
+        if line.trim().is_empty() {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
let trimmed = line.trim();
if line.trim().is_empty() {
🤖 Prompt for AI Agents
In src/wrap.rs around lines 430 to 431, the variable `trimmed` is assigned the
result of `line.trim()` but is only used once immediately after. Remove the
`trimmed` variable and inline the `line.trim()` call directly where `trimmed` is
used to simplify the code.

Comment thread tests/markdownlint.rs
Comment on lines +46 to +56
/// Other markdownlint directives should also remain on their own lines, even
/// when indented or combined with multiple rule names.
#[rstest]
#[case("<!-- markdownlint-disable-line MD001 MD005 -->")]
#[case("<!-- markdownlint-enable MD001 -->")]
#[case(" <!-- markdownlint-disable -->")]
fn test_markdownlint_directive_variants_preserved(#[case] directive: &str) {
let input = lines_vec!["A preceding line.", directive];
let output = process_stream(&input);
assert_eq!(output, input);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Enhance test coverage with edge cases.

The parameterised test covers good basic scenarios but misses important edge cases that could reveal regex pattern issues.

Add additional test cases to cover edge scenarios:

 #[rstest]
 #[case("<!-- markdownlint-disable-line MD001 MD005 -->")]
 #[case("<!-- markdownlint-enable MD001 -->")]
 #[case("    <!-- markdownlint-disable -->")]
+#[case("<!-- markdownlint-disable-next-line MD013 MD014 MD015 -->")]
+#[case("<!--markdownlint-disable-->")]  // No spaces
+#[case("<!-- markdownlint-enable -->")]  // No rule names
+#[case("  <!-- markdownlint-disable-line MD001 -->  ")]  // Trailing whitespace
 fn test_markdownlint_directive_variants_preserved(#[case] directive: &str) {

Also add a negative test case to ensure non-markdownlint comments are not preserved:

#[test]
fn test_non_markdownlint_directives_wrap_normally() {
    let input = lines_vec![
        "Text before comment.",
        "<!-- markdown-disable-next-line -->",  // Missing 'lint'
        "<!-- markdownlint-invalid-directive -->",  // Invalid directive
    ];
    let output = process_stream(&input);
    // Should wrap these comments, not preserve them
    assert_ne!(output, input);
}
🤖 Prompt for AI Agents
In tests/markdownlint.rs around lines 46 to 56, the existing parameterized test
covers basic markdownlint directive scenarios but lacks edge cases and negative
tests. Add more test cases to the parameterized test to include edge cases such
as directives with unusual spacing, mixed case, or combined rules. Additionally,
implement a new test function that verifies non-markdownlint comments (e.g.,
comments missing 'lint' or with invalid directives) are not preserved and are
wrapped normally, ensuring the regex pattern correctly distinguishes valid
directives.

@leynos
Copy link
Copy Markdown
Owner Author

leynos commented Jul 30, 2025

Superseded by #145

@leynos leynos closed this Jul 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant