INNER CODE UNIT · Python
lint_readme
timschneeb/awesome-shizuku · scripts/lint.py:5
def lint_readme(file_path):
app_pattern = re.compile(r'^(\s*(?:\*|-)\s+)\[([^\]]+)\]\(([^)]+)\)(.*?)\s+-\s+(.*)$')
entry_start_pattern = re.compile(r'^\s*(?:\*|-)\s+\[[^\]]+\]\([^)]+\)')
end_pattern = re.compile(r'^(.*?)\s+`([^`]+)`(?:\s+\[\(Source code\)\]\(([^)]+)\))?\s*$')
valid_tags_patterns = [
r'`Paid`\s*💰?',
r'`IAP`\s*💰?',
r'`Ads`',
r'`\d+-\w+ trial`\s*💰?',
r'`Root`\s*💰?',
r'✨'
]
errors = []
with open(file_path, 'r', encoding='utf-8') as f:
lines = f.readlines()