forked from qmk/qmk_firmware
-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for linting deprecated and removed functionality (qmk#17063)
* Add support for more lint warnings/errors * Develop currently needs extra deps installed * Lint a few more scenarios * fix tests
- Loading branch information
Showing
5 changed files
with
128 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: PR Lint keyboards | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'keyboards/**' | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
container: qmkfm/qmk_cli | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Install dependencies | ||
run: pip3 install -r requirements-dev.txt | ||
|
||
- uses: trilom/[email protected] | ||
id: file_changes | ||
with: | ||
output: '\n' | ||
|
||
- name: Print info | ||
run: | | ||
git rev-parse --short HEAD | ||
echo ${{ github.event.pull_request.base.sha }} | ||
echo '${{ steps.file_changes.outputs.files}}' | ||
- name: Run qmk lint | ||
shell: 'bash {0}' | ||
run: | | ||
QMK_CHANGES=$(echo -e '${{ steps.file_changes.outputs.files}}') | ||
QMK_KEYBOARDS=$(qmk list-keyboards) | ||
exit_code=0 | ||
for KB in $QMK_KEYBOARDS; do | ||
KEYBOARD_CHANGES=$(echo "$QMK_CHANGES" | grep -E '^(keyboards/'${KB}'/)') | ||
if [[ -z "$KEYBOARD_CHANGES" ]]; then | ||
# skip as no changes for this keyboard | ||
continue | ||
fi | ||
KEYMAP_ONLY=$(echo "$KEYBOARD_CHANGES" | grep -cv /keymaps/) | ||
if [[ $KEYMAP_ONLY -gt 0 ]]; then | ||
echo "linting ${KB}" | ||
qmk lint --keyboard ${KB} && qmk info -l --keyboard ${KB} | ||
exit_code=$(($exit_code + $?)) | ||
fi | ||
done | ||
if [[ $exit_code -gt 255 ]]; then | ||
exit 255 | ||
fi | ||
exit $exit_code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters