mirror of
https://github.com/digitalsamba/claude-code-video-toolkit.git
synced 2026-09-18 19:41:13 +08:00
6ce0a46095
`tools/dewatermark.py --setup` aborted with `NameError: get_runpod_config` before
doing any work — the helper is defined nowhere in the repo. Replaced with the
`load_dotenv()` + `os.getenv("RUNPOD_API_KEY")` pattern `tools/upscale.py` already
uses in the same function. Verified: setup now runs and finds the existing
template/endpoint.
Follow-up cleanup to the _migrate_common refactor (#85):
- `_migrate_common.load_mapping` was a stub returning raw JSON, so any caller
would KeyError on `mapping["skip_commands"]`. Nothing hit it because both
scripts shadowed it with a local copy. Promoted the real normalizing version
(handles `None`, coerces skip lists to sets) and dropped both local copies.
- Dropped the duplicate `find_repo_root` from both scripts; the shared one is
equivalent and has a better error message.
- Dropped the unused `yaml_quote` import from migrate_to_kiro.py.
Verified behaviour-neutral: `migrate_to_codex.py --force` and
`migrate_to_kiro.py --force` produce byte-identical output trees before and after.
New Lint Python workflow gates on undefined names (F821/F811/F822/F823) across
scripts/ and tools/. Scoped to rules where a hit is a real defect — the repo has
~800 unused-import and unused-local warnings that are not worth gating on.
Confirmed against the tagged v0.20.0 tree, where it reports 26 errors including
both `write_text` sites that broke the Codex and Kiro migrations.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
59 lines
2.0 KiB
YAML
59 lines
2.0 KiB
YAML
name: Lint Python
|
|
|
|
# Catches the crash class of Python bug — a name that is called but never
|
|
# defined — before it reaches a release. This exists because v0.20.0 shipped
|
|
# `scripts/migrate_to_{codex,kiro}.py` with an undefined `write_text`, which
|
|
# made both migrations abort with a NameError on the first real write (#85).
|
|
# `--dry-run` returned before touching that path, so nothing caught it.
|
|
#
|
|
# Deliberately narrow: only rules where a hit is a genuine defect, never a
|
|
# style opinion. The repo has ~800 unused-import / unused-local warnings that
|
|
# are not worth gating on, so they stay out. Add a code here only if a hit
|
|
# means the code is actually broken.
|
|
#
|
|
# F821 undefined name -> NameError at runtime
|
|
# F811 redefinition of unused name -> a later def silently shadows an import
|
|
# F822 undefined name in __all__
|
|
# F823 local variable referenced before assignment
|
|
# E999 syntax error
|
|
#
|
|
# Verified against the tagged v0.20.0 tree: this gate reports 26 errors there,
|
|
# including both `write_text` call sites and the F811 shadowing.
|
|
#
|
|
# Known limit: ruff resolves names per-file, not across modules. If a name is
|
|
# still imported but has been deleted from the module it is imported from, the
|
|
# import counts as a definition and this gate stays green. It catches the
|
|
# v0.20.0 bug because that refactor dropped the import too.
|
|
#
|
|
# Run the same check locally with:
|
|
# uvx ruff check --select F821,F811,F822,F823 scripts/ tools/
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- '**.py'
|
|
- '.github/workflows/lint-python.yml'
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- '**.py'
|
|
- '.github/workflows/lint-python.yml'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
lint:
|
|
name: undefined names
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install uv
|
|
uses: astral-sh/setup-uv@v5
|
|
|
|
- name: Check for undefined names
|
|
run: uvx ruff check --select F821,F811,F822,F823 --output-format github scripts/ tools/
|