Skip to content

Commit fbfcc60

Browse files
committed
Got the template check script to work.
1 parent dbdf236 commit fbfcc60

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ jobs:
7070
- name: Lint with flake8
7171
run: |
7272
# stop the build if there are Python syntax errors or undefined names
73-
flake8 --exclude ./test --count --select=E9,F63,F7,F82 --show-source --statistics
73+
flake8 --exclude ./test ./python/exercises/concept --count --select=E9,F63,F7,F82 --show-source --statistics
7474
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
7575
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
7676
7777
- name: Test template status
7878
continue-on-error: true
7979
run: |
80-
bin/template_status.py -v -p ./problem-specifications
80+
bin/template_status.py -v -p ./problem-specifications --spec-path ./python
8181
8282
- name: Check exercises
8383
run: |

bin/data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def __post_init__(self):
330330
self.tags = []
331331

332332
@classmethod
333-
def load(cls, path="config.json"):
333+
def load(cls, path="/__w/python-test-runner/python-test-runner/python/config.json"):
334334
try:
335335
with Path(path).open() as f:
336336
return cls(**json.load(f))

bin/template_status.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def filter_exercises(exercises: List[ExerciseInfo], pattern: str) -> Iterator[Ex
8282
if exercise.type == 'concept':
8383
# Concept exercises are not generated
8484
continue
85-
if fnmatch(exercise["slug"], pattern):
85+
if fnmatch(exercise.slug, pattern):
8686
yield exercise
8787

8888

@@ -116,7 +116,7 @@ def filter_exercises(exercises: List[ExerciseInfo], pattern: str) -> Iterator[Ex
116116
TemplateStatus.TEST_FAILURE: [],
117117
}
118118
config = Config.load()
119-
for exercise in filter_exercises(config.exercises.all()):
119+
for exercise in filter_exercises(config.exercises.all(), "*"):
120120
status = get_status(exercise, opts.spec_path)
121121
if status == TemplateStatus.OK:
122122
logger.info(f"{exercise.slug}: {status.name}")

0 commit comments

Comments
 (0)