Skip to content

fix: resolve all ruff lint errors#153

Open
Emin017 wants to merge 12 commits into
emin/typed-toolsfrom
emin/resolve-ruff-lint
Open

fix: resolve all ruff lint errors#153
Emin017 wants to merge 12 commits into
emin/typed-toolsfrom
emin/resolve-ruff-lint

Conversation

@Emin017

@Emin017 Emin017 commented Jul 21, 2026

Copy link
Copy Markdown
Member

What Changed

Scope

Select the areas touched by this PR:

  • CLI - command behavior, Typer command surface, output formats, or workspace commands.
  • Flow/runtime - workspace lifecycle, EngineFlow, step execution, logs, metrics, or artifacts.
  • EDA integration - Yosys, ECC-Tools, DreamPlace, KLayout, PDKs, or native/runtime wrappers.
  • Build/package - Nix, PyInstaller, wheels, uv.lock, or release artifacts.
  • CI/release - GitHub Actions, version checks, changelog, or release automation.
  • Tests/docs only

Validation

List the commands you ran. Mark checks that are not applicable as N/A.

  • uv run pytest test/
  • Focused pytest:
  • uv run ruff check chipcompiler test
  • uv run ruff format --check chipcompiler test
  • PyInstaller smoke: ecc --help, ecc --version, ecc version --json
  • Nix smoke: nix run .#cli -- --help
  • Manual flow smoke:
  • Other:

Skipped checks and reason:

Runtime And Packaging Impact

  • No runtime or packaging impact
  • CLI output or machine-readable contract changed
  • Workspace layout, flow state, or artifact paths changed
  • Native toolchain or wrapper behavior changed
  • ecc-tools or ecc-dreamplace dependency changed
  • PyInstaller, Nix, or release artifact changed

Notes:

Checklist

  • I kept the change scoped to ECC.
  • I updated docs or user-facing CLI text where behavior changed.
  • I included lockfile or version metadata updates when dependencies changed.
  • I documented any submodule updates and why they are needed.
  • I did not include local caches, virtual environments, or generated build outputs.
  • I explained skipped validation and remaining risk.

Emin017 added 7 commits July 21, 2026 21:10
…xplicit | None)

`get_eda_instance` and the per-step `run_*` functions declared
`ecc_module: ECCToolsModule = None` (implicit-Optional) and
`get_eda_instance`
returned `-> ECCToolsModule` despite returning None on its failure path.
These
functions already handle None correctly at runtime — each reassigns via
`get_eda_instance(...)` and guards with `if ecc_module is not None:` —
so only the
annotations were wrong. The mistyped signatures forced pyright to flag
every
None-origin argument down the call chain, including the 4 errors in
ecc_dreamplace/runner.py.

Fix the root: `get_eda_instance(ecc_module: ECCToolsModule | None =
None) ->
ECCToolsModule | None`, and the 13 `run_*` `ecc_module` params to
`ECCToolsModule | None = None` (matching run_step/run_sta_without_spef
which were
already correct).

Behavior-neutral. ecc_dreamplace/runner.py: 4 → 0 pyright errors;
ecc/runner.py:
80 → 44 (cleared 36 pre-existing None-cascade errors, introduced none).
Zero new
ruff. Full pytest 1036 passed.
UP009 drop obsolete encoding declarations, UP015 redundant open modes,
UP045 Optional[X] -> X | None, UP006 typing.Dict/List -> builtins,
UP032 .format -> f-string, UP035 remove deprecated typing import in
utility/filelist.py. Includes the earlier runner.py autofix batch
(I001/F401/F841/UP009/UP032) whose hunks are entangled with UP009.

Gate: ruff --select UP = 0; pytest 1036 passed; per-file pyright
diagnostic multisets identical before/after (repo-wide pyright counts
fluctuate run-to-run, per-file is the trustworthy gate).
Pure line-wrapping, no behavior change: hanging-indent call args,
parenthesized boolean chains, implicit-concat f-string splits.

Gate: ruff E501 68 -> 0 with all other rule counts byte-identical;
pytest 1036 passed; per-file pyright diagnostic multisets identical.
@Emin017 Emin017 added the bug Something isn't working label Jul 21, 2026
@Emin017
Emin017 force-pushed the emin/resolve-ruff-lint branch from 317f165 to e039bfe Compare July 21, 2026 13:32
Signed-off-by: Emin <me@emin.chat>
@Emin017
Emin017 marked this pull request as ready for review July 22, 2026 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant