Ignore EOF blank line check
This commit is contained in:
Executable
+15
@@ -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
|
||||
Reference in New Issue
Block a user