OpenCoD2-Plus
Call of Duty 2 client & server, rebuilt
Loading...
Searching...
No Matches
check_docs Namespace Reference

Functions

 md_files (root)
 check_file (root, path)
 find_problems (root, files)
 main ()

Variables

 LINK = re.compile(r'\‍[[^\‍]]*\‍]\‍(([^)\s]+)\‍)')
 CODE = re.compile(r'`([^`\n]+)`')
tuple REPO_DIRS = ('src/', 'scripts/', 'test/', 'docs/', 'cmake/', 'mods/', 'third_party/')
list SENSITIVE
str MEMORY = 'docs/ai/PROJECT_MEMORY.md'
int MAX_BULLETS = 3

Detailed Description

Checks the documentation against the repository.

    python3 scripts/check_docs.py [ROOT]

Reads AGENTS.md, the README files and docs/**/*.md (not docs/superpowers,
which is local) and prints one line per problem, as path:line: message:
a relative link to a file that does not exist; a repository path (src/,
scripts/, test/, docs/, cmake/, mods/, third_party/) anywhere in backticks
that does not exist; personal data (a Windows drive path but the
C:\\path\\to\\ placeholder, /home/<name> or /mnt/<drive>, an IPv4 address
but 127.0.0.1 and 0.0.0.0, a CD key or the word codkey); a stage
of docs/ai/PROJECT_MEMORY.md with more than 3 bullets. Paths in the memory and in a
superseded ADR are not checked: they describe what was. Exits with 0 when
there are none.

Function Documentation

◆ check_file()

check_docs.check_file ( root,
path )

◆ find_problems()

check_docs.find_problems ( root,
files )

◆ main()

check_docs.main ( )

◆ md_files()

check_docs.md_files ( root)

Variable Documentation

◆ CODE

check_docs.CODE = re.compile(r'`([^`\n]+)`')

◆ LINK

check_docs.LINK = re.compile(r'\‍[[^\‍]]*\‍]\‍(([^)\s]+)\‍)')

◆ MAX_BULLETS

int check_docs.MAX_BULLETS = 3

◆ MEMORY

str check_docs.MEMORY = 'docs/ai/PROJECT_MEMORY.md'

◆ REPO_DIRS

tuple check_docs.REPO_DIRS = ('src/', 'scripts/', 'test/', 'docs/', 'cmake/', 'mods/', 'third_party/')

◆ SENSITIVE

list check_docs.SENSITIVE
Initial value:
1= [
2 (re.compile(r'\b[A-Za-z]:[\\/](?!path[\\/]to[\\/])'), 'a Windows drive path'),
3 (re.compile(r'/home/\w|/mnt/[a-z]/'), 'a personal Unix path'),
4 (re.compile(r'(?<!version )(?<![\w.])(?!127\.0\.0\.1\b)(?!0\.0\.0\.0\b)\d{1,3}(?:\.\d{1,3}){3}\b'), 'an IP address'),
5 (re.compile(r'codkey', re.I), 'a CD key'),
6 (re.compile(r'\b[A-Z0-9]{4}(?:-[A-Z0-9]{4}){4}\b'), 'a CD key'),
7]