Skip to content

Commit 17cecf3

Browse files
committed
Add a doctypes linter to prevent further mistakes.
1 parent b2092ee commit 17cecf3

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/lint-doctypes.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint doctypes.kdl
2+
3+
on:
4+
push:
5+
paths:
6+
- "boilerplate/doctypes.kdl"
7+
pull_request:
8+
paths:
9+
- "boilerplate/doctypes.kdl"
10+
workflow_dispatch: {}
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.10'
22+
- name: Install kdl
23+
run: pip install kdl
24+
- name: Verify failing tests and orphaned tests
25+
run: |
26+
python .github/workflows/lint/lint-doctypes.py
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from __future__ import annotations
2+
3+
import os
4+
import sys
5+
import typing
6+
7+
import kdl
8+
9+
with io.open("boilerplate/doctypes.kdl", "r") as fh:
10+
text = fh.read()
11+
kdl.parse(text)

0 commit comments

Comments
 (0)