Files
AnyPS5/tools/tests/test_check_conventions_agent_files.py
T
pushkarreddyy bf1aadea66 fix(conventions): reject modern agent instruction files
Expand AGENT_FILES in tools/check_conventions.py to include instruction and configuration files for modern AI coding assistants (.windsurfrules, windsurf.md, chatgpt.md, .chatgptrules, .aider.conf.yml). Add test coverage in tools/tests/test_check_conventions_agent_files.py.
2026-10-13 23:39:04 +05:30

29 lines
979 B
Python

import sys
import unittest
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
from check_conventions import allowed_notes
class AgentFileTests(unittest.TestCase):
def test_agent_files_are_rejected_in_any_case(self):
for name in (
"CLAUDE.md", "claude.md", "Claude.md", "AGENTS.md", "Agents.md", "GEMINI.md",
"Copilot-Instructions.md", ".CursorRules", ".WindsurfRules", "windsurf.md",
"ChatGPT.md", ".ChatGPTRules", ".aider.conf.yml",
):
with self.subTest(name=name):
self.assertIs(allowed_notes(f"docs/dev/{name}"), False)
self.assertIs(allowed_notes(name), False)
def test_ordinary_docs_are_still_allowed(self):
self.assertTrue(allowed_notes("docs/dev/Claudette.md"))
self.assertTrue(allowed_notes("README.md"))
self.assertIs(allowed_notes("core/x.cpp"), None)
if __name__ == "__main__":
unittest.main()