docs: add bilingual READMEs for top-level directories

This commit is contained in:
TakuyaYagam1 committed 2026-10-05 17:48:48 +03:00
1 parent e9f56a6aa2
commit 70f96adf26
29 files changed
+401 -8

No files matched your search

+20 -8
View File
@@ -33,6 +33,7 @@ IGNORED_DIRS = {
"venv",
}
LANGUAGE_DOCS = {"ARCHITECTURE.md", "DEPLOY.md", "DEVELOPMENT.md", "TESTING.md"}
README_NAMES = ("README.md", "README.en.md")
INLINE_LINK = re.compile(
r"!?\[[^\]]*\]\(\s*(<[^>]+>|(?:\\.|[^\s)])+)(?:\s+[^)]*)?\)"
)
@@ -187,13 +188,24 @@ def check_language_docs(root: Path, errors: list[str]) -> None:
errors.append("docs/ru and docs/en filenames do not match: " + "; ".join(details))
def check_root_readme(files: list[Path], root: Path, errors: list[str]) -> None:
expected = (root / "README.md").resolve()
if not expected.is_file():
errors.append("missing root README.md")
nested = [path for path in files if path.name.lower() == "readme.md" and path != expected]
for path in nested:
errors.append(f"nested README is not allowed: {path.relative_to(root)}")
def check_readmes(files: list[Path], root: Path, errors: list[str]) -> None:
directories = {root}
for path in files:
if path.name not in README_NAMES:
continue
relative = path.relative_to(root)
if relative.parts[0] == ".github":
continue
if len(relative.parts) > 2:
errors.append(f"README is below a top-level directory: {relative}")
continue
directories.add(path.parent)
file_set = set(files)
for directory in sorted(directories):
for name in README_NAMES:
path = directory / name
if path not in file_set:
errors.append(f"missing README translation: {path.relative_to(root)}")
for name in ("AGENTS.md", "CLAUDE.md", "AGENTS_ROUTING.md"):
if not (root / name).is_file():
errors.append(f"missing root {name}")
@@ -255,7 +267,7 @@ def validate_repository(root: Path) -> list[str]:
root = root.resolve()
errors: list[str] = []
files = markdown_files(root)
check_root_readme(files, root, errors)
check_readmes(files, root, errors)
check_language_docs(root, errors)
routing = root / "AGENTS_ROUTING.md"