Skip to content

chore: wire ruff and parallel tests into CI, and guard stdout encoding - #93

Merged
917Dhj merged 1 commit into
developfrom
chore/ci-guardrails
Nov 7, 2026
Merged

917Dhj merged 1 commit into
developfrom
chore/ci-guardrails

Conversation

@917Dhj

@917Dhj 917Dhj commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Summary

 .github/workflows/ci.yml
   Run syntax check
-    python -m compileall -q skills/deeppapernote/scripts
+    python -m compileall -q skills
+  Run lint
+    python -m ruff check skills tests          # rules: F
   Run tests
-    python -m pytest -q
+    python -m pytest -q -n auto
  • ruff: it was already a dev dependency with a config, but CI never ran it. The rule set is narrowed to F, the pyflakes class. E501 would add 871 findings and I001 would add 46, so those stay off until the code is cleaned up.
  • The 7 F findings fixed:
    • a duplicated "schema_version" key in a test fixture;
    • an unused local in lint_note.py;
    • 5 unused imports. One of them, GLOSSARY_DISCLAIMER, was re-exported for a test, which now imports it from glossary_contracts.
  • pytest-xdist is added to the dev extra.
  • Stdout guard: tests/test_console_encoding.py adds an AST check that fails if any skills/*/scripts/*.py prints json.dumps(..., ensure_ascii=False) to stdout, either directly or through a variable. This is the pattern fix: script output survives a console encoding such as cp1252 #92 fixed; CI's PYTHONUTF8=1 hides it.
  • AGENTS.md:
    • It now points to the three companion skills.
    • It states that they use only the standard library and never import DeepPaperNote code.
    • It names the two tests that pin the file formats they share.
    • It lists the new test and lint commands.

Evidence

Merge Danger

Door: two-way

Blast Radius: CI only.

  • A new F-class lint error now fails CI.
  • Tests run in parallel, so a test that is not parallel-safe could become flaky. None showed up in two local runs.

🤖 Generated with Claude Code

- CI runs `ruff check skills tests` with the rule set narrowed to F, after
  fixing the 7 existing F findings (a duplicate dict key, an unused
  variable, unused imports).
- Tests run in parallel with pytest-xdist (`-n auto`): about 51 s instead
  of 194 s locally. compileall now covers every skill's scripts.
- A static test fails when a script prints `json.dumps(..., ensure_ascii=False)`
  to stdout, the pattern that broke cp1252 consoles.
- AGENTS.md points to the companion skills, their standalone rule, and the
  tests that pin the formats they share with DeepPaperNote.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@917Dhj
917Dhj merged commit a41586b into develop Nov 7, 2026
3 checks passed
@917Dhj
917Dhj deleted the chore/ci-guardrails branch November 9, 2026 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant