Skip to content

Commit 247e233

Browse files
authored
Merge pull request #480 from riscv-software-src/pylint
Github workflow to run pylint against debug tests
2 parents 4b88f42 + fe15afe commit 247e233

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

.github/workflows/debug.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
on: pull_request
2+
3+
name: Check Code Style (checkpatch)
4+
5+
jobs:
6+
check:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout Code
10+
uses: actions/checkout@v3
11+
with:
12+
fetch-depth: 0
13+
- name: Install required packages (pip3)
14+
run: |
15+
pip3 install pylint
16+
- name: Run pylint
17+
run: make -C debug pylint

debug/testlib.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -952,14 +952,17 @@ def load_excluded_tests(excluded_tests_file, target_name):
952952
return result
953953

954954
target_excludes = {}
955-
with open(excluded_tests_file) as file:
955+
with open(excluded_tests_file, encoding="utf-8") as file:
956956
raw_data = yaml.safe_load(file)
957957
for (target, test_list) in raw_data.items():
958958
if not isinstance(test_list, list):
959-
raise ValueError(f"Target {target!r} does not contain a test list", excluded_tests_file, test_list)
959+
raise ValueError(
960+
f"Target {target!r} does not contain a test list",
961+
excluded_tests_file, test_list)
960962
if not all(isinstance(s, str) for s in test_list):
961-
raise ValueError(f"Not every element in the target test list {target!r} is a string",
962-
excluded_tests_file, test_list)
963+
raise ValueError(
964+
f"Not every element in the target test list {target!r} "
965+
"is a string", excluded_tests_file, test_list)
963966

964967
target_excludes.update(raw_data)
965968

0 commit comments

Comments
 (0)