Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 5, 2025

This PR closes #3560

Description

Adds a markdownlint rule that flags @MASTG-TOOL-xxxx references in tests-beta/ files. Per mastg-test.instructions.md, tests should reference techniques (@MASTG-TECH-xxxx) rather than tools directly.

Implementation:

  • Created tests-beta/.markdownlint-cli2.jsonc with per-directory config
  • Added no-tool-references-in-tests search-replace rule matching /@MASTG-TOOL-\d{4}/g
  • Duplicated parent search-replace rules (required—arrays don't merge with extends)

Note: The search-replace plugin doesn't support path-based filtering for individual rules. Adding the rule to the main .markdownlint.jsonc would apply it globally. Per-directory config using .markdownlint-cli2.jsonc is the standard markdownlint approach for path-specific rules.

Behavior:


[x] I have read the contributing guidelines.

Original prompt

This section details on the original issue you should resolve

<issue_title>Lint rule: ensure TOOLS are not mentioned in TESTs</issue_title>
<issue_description>As per mastg-test.instructions.md MASTG-TOOLs should not be mentioned in MASTG-TESTs. We should use MASTG-TECHs instead.

#3559 is the first step to align this, but we need to create a lint rule.

Create a rule in .markdownlint.jsonc for this.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add lint rule to ensure tools are not mentioned in tests Add lint rule to prevent MASTG-TOOL references in tests-beta Dec 5, 2025
Copilot AI requested a review from cpholguera December 5, 2025 11:29
Copilot finished work on behalf of cpholguera December 5, 2025 11:29
@cpholguera
Copy link
Collaborator

@copilot let's better move the rule to the main ".markdownlint.jsonc", and restrict it to the tests-beta path

Copy link
Contributor Author

Copilot AI commented Dec 5, 2025

@copilot let's better move the rule to the main ".markdownlint.jsonc", and restrict it to the tests-beta path

The search-replace plugin doesn't support path-based filtering for individual rules. Since search-replace.rules arrays don't merge with extends in markdownlint, adding the rule to the main config would apply it globally (flagging demos, tools, techniques, etc.).

The cleanest approach within markdownlint's architecture is a per-directory config. I've switched from .markdownlint.jsonc to .markdownlint-cli2.jsonc in tests-beta/ which:

  • Makes it clearer this is directory-specific config (cli2 configs are designed for per-directory overrides)
  • Still requires duplicating parent rules (due to array non-merging), but adds clear documentation

If you'd prefer a different approach, please let me know. Alternatives would require either a custom markdownlint plugin with path filtering support, or using a different linting mechanism entirely.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/OnkarRuikar/markdownlint-rule-search-replace/issues
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of cpholguera December 5, 2025 12:37
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.

Lint rule: ensure TOOLS are not mentioned in TESTs

2 participants