From 2eb6275709d6c506cb94e9588dcf8e7dd0407589 Mon Sep 17 00:00:00 2001 From: Daniel <71837281+darmiel@users.noreply.github.com> Date: Sat, 19 Aug 2023 22:31:02 +0200 Subject: [PATCH] feat: name check --- .fff-ir-lint.json | 72 ++++++++++++++++++++++++++++++++++ .github/workflows/pr-lint.yaml | 3 +- 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 .fff-ir-lint.json diff --git a/.fff-ir-lint.json b/.fff-ir-lint.json new file mode 100644 index 00000000..18cedf0e --- /dev/null +++ b/.fff-ir-lint.json @@ -0,0 +1,72 @@ +{ + "name-check": { + "$path-prefix": "", + "$groups": { + "power": [ + "power", + "pwr", + "/^((power|pwr)[_\\s]*)?(toggle|on|off)$/", + "/^(turn[_\\s]*)?(on|off)$/" + ], + "vol_up": [ + "/^vol(ume)?[_\\s]*(up|[\\^+])$/" + ], + "vol_dn": [ + "/^vol(ume)?[_\\s]*(d(o?w)?n|[v\\-])$/" + ], + "ch_next": [ + "/^ch(an(nel)?)?[_\\s]*(up|[\\^+])$/" + ], + "ch_prev": [ + "/^ch(an(nel)?)?[_\\s]*(d(o?w)?n|[\\v-])$/" + ], + "mute": [ + "mute", + "mte", + "/^mute.*$/" + ] + }, + "TVs/*": { + "Power": [ + "$group:power", + "off", + "on" + ], + "Vol_up": [ + "$group:vol_up" + ], + "Vol_dn": [ + "$group:vol_dn" + ], + "Ch_next": [ + "$group:ch_next" + ], + "Ch_prev": [ + "$group:ch_prev" + ], + "Mute": [ + "$group:mute" + ] + }, + "ACs/*": { + "Off": [ + "off", + "/^((power|pwr)[_\\s]*)?off$/" + ] + }, + "Audio_Receivers/*,SoundBars/*,Speakers/*": { + "Power": [ + "$group:power" + ], + "Vol_up": [ + "$group:vol_up" + ], + "Vol_dn": [ + "$group:vol_dn" + ], + "Mute": [ + "$group:mute" + ] + } + } + } \ No newline at end of file diff --git a/.github/workflows/pr-lint.yaml b/.github/workflows/pr-lint.yaml index cb34d57a..2a16816b 100644 --- a/.github/workflows/pr-lint.yaml +++ b/.github/workflows/pr-lint.yaml @@ -22,6 +22,7 @@ jobs: with: repository: 'darmiel/fff-ir-lint' path: fff-ir-lint + ref: 'feat/name-check' # only check files changed in the PR - name: Get Changed Files @@ -44,7 +45,7 @@ jobs: id: run continue-on-error: true with: - run: python fff-ir-lint/main.py github2 file:changed_file_list.txt + run: 'LINTER_CONFIG=.fff-ir-lint.json python fff-ir-lint/main.py github2 file:changed_file_list.txt' - uses: ntsd/auto-request-changes-action@v2 name: "Request Changes"