Ignore EOF blank line check

This commit is contained in:
Julian Piribauer
2026-07-26 14:42:06 +02:00
parent 1f930b01fc
commit 80072b291f
3 changed files with 20 additions and 7 deletions
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# Reproduces the CI "Preparse .sage files" step locally, so `ruff check` sees
# the same generated *.sage.py files that the pipeline lints. Run this before
# `sage --python -m ruff check --no-respect-gitignore .` to catch issues that
# only show up in the generated output (e.g. missing trailing newlines).
#
# The generated files are gitignored; clean them up afterwards with:
# git clean -x sage/ playground/
set -e
for f in $(find . -name "*.sage" -not -path "./playground/*"); do
sage --preparse "$f"
printf 'from sage.all import * # noqa: F401,F403\n%s\n' "$(cat "${f}.py")" > "${f}.py"
done
+1 -6
View File
@@ -24,12 +24,7 @@ jobs:
# parse it, and prepends the `from sage.all import *` that `sage`
# normally injects at runtime, so Sage's globals (ZZ, var, matrix, ...)
# resolve instead of looking like undefined names.
run: |
set -e
for f in $(find . -name "*.sage" -not -path "./playground/*"); do
sage --preparse "$f"
printf 'from sage.all import * # noqa: F401,F403\n%s\n' "$(cat "${f}.py")" > "${f}.py"
done
run: .gitea/preparse.sh
- name: ruff check
# --no-respect-gitignore: *.sage.py is gitignored (it's generated, see