Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the qmk lint readme check #13941

Merged
merged 2 commits into from
Aug 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lib/python/qmk/cli/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from qmk.decorators import automagic_keyboard, automagic_keymap
from qmk.info import info_json
from qmk.keyboard import keyboard_completer
from qmk.keyboard import find_readme, keyboard_completer
from qmk.keymap import locate_keymap
from qmk.path import is_keyboard, keyboard

Expand All @@ -31,7 +31,8 @@ def lint(cli):
ok = True
keyboard_path = keyboard(cli.config.lint.keyboard)
keyboard_info = info_json(cli.config.lint.keyboard)
readme_path = keyboard_path / 'readme.md'
readme_path = find_readme(cli.config.lint.keyboard)
missing_readme_path = keyboard_path / 'readme.md'

# Check for errors in the info.json
if keyboard_info['parse_errors']:
Expand All @@ -43,9 +44,9 @@ def lint(cli):
cli.log.error('Warnings found when generating info.json (Strict mode enabled.)')

# Check for a readme.md and warn if it doesn't exist
if not readme_path.exists():
if not readme_path:
ok = False
cli.log.error('Missing %s', readme_path)
cli.log.error('Missing %s', missing_readme_path)

# Keymap specific checks
if cli.config.lint.keymap:
Expand Down