Skip to content

Commit

Permalink
Merge pull request #480 from riscv-software-src/pylint
Browse files Browse the repository at this point in the history
Github workflow to run pylint against debug tests
  • Loading branch information
timsifive authored Jun 29, 2023
2 parents 4b88f42 + fe15afe commit 247e233
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/debug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on: pull_request

name: Check Code Style (checkpatch)

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install required packages (pip3)
run: |
pip3 install pylint
- name: Run pylint
run: make -C debug pylint
11 changes: 7 additions & 4 deletions debug/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,14 +952,17 @@ def load_excluded_tests(excluded_tests_file, target_name):
return result

target_excludes = {}
with open(excluded_tests_file) as file:
with open(excluded_tests_file, encoding="utf-8") as file:
raw_data = yaml.safe_load(file)
for (target, test_list) in raw_data.items():
if not isinstance(test_list, list):
raise ValueError(f"Target {target!r} does not contain a test list", excluded_tests_file, test_list)
raise ValueError(
f"Target {target!r} does not contain a test list",
excluded_tests_file, test_list)
if not all(isinstance(s, str) for s in test_list):
raise ValueError(f"Not every element in the target test list {target!r} is a string",
excluded_tests_file, test_list)
raise ValueError(
f"Not every element in the target test list {target!r} "
"is a string", excluded_tests_file, test_list)

target_excludes.update(raw_data)

Expand Down

0 comments on commit 247e233

Please sign in to comment.