Skip to main content

scripts-fix-md044-proper-names

#!/usr/bin/env python3 """

CODITECT Markdown Quality System Copyright © 2025 AZ1.AI INC - All Rights Reserved"""

MD044: Proper names should have correct capitalization

Note: This requires a dictionary of proper names - placeholder implementation

from pathlib import Path

PROPER_NAMES = { 'github': 'GitHub', 'javascript': 'JavaScript', 'typescript': 'TypeScript', 'python': 'Python', 'react': 'React', 'vue': 'Vue', 'docker': 'Docker' }

def fix_md044(content): fixed = 0 for wrong, correct in PROPER_NAMES.items(): if wrong in content.lower(): import re content, n = re.subn(r'\b' + wrong + r'\b', correct, content, flags=re.IGNORECASE) fixed += n return content, fixed

def process_file(file_path, dry_run=False): with open(file_path, 'r', encoding='utf-8') as f: content = f.read() fixed_content, count = fix_md044(content) if count > 0 and not dry_run: with open(file_path, 'w', encoding='utf-8') as f: f.write(fixed_content) return count

if name == 'main': import argparse parser = argparse.ArgumentParser() parser.add_argument('paths', nargs='*', default=['.']) parser.add_argument('--dry-run', action='store_true') args = parser.parse_args()

total = 0
for path_str in args.paths:
path = Path(path_str)
if path.is_file() and path.suffix == '.md':
count = process_file(path, args.dry_run)
if count:
print(f"{'[DRY RUN] ' if args.dry_run else ''}Fixed {count} in {path}")
total += count
elif path.is_dir():
for md_file in path.rglob('*.md'):
count = process_file(md_file, args.dry_run)
if count:
print(f"{'[DRY RUN] ' if args.dry_run else ''}Fixed {count} in {md_file}")
total += count
print(f"\nTotal: {total} fixed")