Skip to content

Commit aa1afc8

Browse files
christian-byrnearjansingh
authored andcommitted
[ci] add Python syntax checking workflow on changes to devtools (#5841)
## Summary Added CI workflow and npm script for Python syntax validation in devtools directory. ## Changes - **What**: Added GitHub Actions workflow for Python syntax checking with `python3 -m compileall` - **Dependencies**: Added `python3` binary to knip ignore list ## Review Focus Workflow triggers correctly on devtools path changes and Python syntax validation covers all relevant files. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5841-ci-add-Python-syntax-checking-workflow-on-changes-to-devtools-27c6d73d365081b8963dd4600a233852) by [Unito](https://www.unito.io)
1 parent 420586c commit aa1afc8

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Devtools Python Check
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'tools/devtools/**'
7+
push:
8+
branches: [ main ]
9+
paths:
10+
- 'tools/devtools/**'
11+
12+
jobs:
13+
syntax:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Validate Python syntax
26+
run: python3 -m compileall -q tools/devtools

knip.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const config: KnipConfig = {
2020
project: ['src/**/*.{js,ts}', '*.{js,ts,mts}']
2121
}
2222
},
23+
ignoreBinaries: ['python3'],
2324
ignoreDependencies: [
2425
// Weird importmap things
2526
'@iconify/json',

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"collect-i18n": "pnpm exec playwright test --config=playwright.i18n.config.ts",
3939
"json-schema": "tsx scripts/generate-json-schema.ts",
4040
"storybook": "nx storybook -p 6006",
41-
"build-storybook": "storybook build"
41+
"build-storybook": "storybook build",
42+
"devtools:pycheck": "python3 -m compileall -q tools/devtools"
4243
},
4344
"devDependencies": {
4445
"@eslint/js": "^9.35.0",

0 commit comments

Comments
 (0)