Skip to content

Commit 8a27f5a

Browse files
authored
chore: make tests run on scripts + fix linting (#10580)
1 parent 9a03e76 commit 8a27f5a

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ on:
2323
- "test/**/*.py"
2424
- "pyproject.toml"
2525
- ".github/utils/*.py"
26+
- "scripts/*.py"
2627

2728
env:
2829
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}

.github/workflows/tests_skipper_trigger.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ on:
1717
- "test/**/*.py"
1818
- "pyproject.toml"
1919
- ".github/utils/*.py"
20+
- "scripts/*.py"
2021

2122
jobs:
2223
check_if_changed:
@@ -40,6 +41,7 @@ jobs:
4041
- "test/**/*.py"
4142
- "pyproject.toml"
4243
- ".github/utils/*.py"
44+
- "scripts/*.py"
4345
4446
trigger-catch-all:
4547
name: Tests completed

scripts/ruff_format_docs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ def main() -> int:
113113
for path in args.files:
114114
with open(path) as f:
115115
original = f.read()
116-
new = PYTHON_FENCE_RE.sub(lambda m: _format_code_block(m, line_length=args.line_length, path=path), original)
116+
new = PYTHON_FENCE_RE.sub(
117+
lambda m, path=path: _format_code_block(m, line_length=args.line_length, path=path), original
118+
)
117119
if new != original:
118120
with open(path, "w") as f:
119121
f.write(new)

0 commit comments

Comments
 (0)