Skip to content

Ruff formatting, lint/codacy fixes, and dead-code cleanup - #33

Merged
mmacferrin merged 4 commits into
mainfrom
lint-format-and-bugfixes
Jul 16, 2026
Merged

Ruff formatting, lint/codacy fixes, and dead-code cleanup#33
mmacferrin merged 4 commits into
mainfrom
lint-format-and-bugfixes

Conversation

@mmacferrin

Copy link
Copy Markdown
Collaborator

Summary

  • Applies a repo-wide ruff format + ruff check --fix pass and hand-fixes the remaining lint/codacy findings in src/ivert/ (E721, E402, E711/E712, E741, F401/F841, invalid escape sequences). archive/ is excluded from ruff linting (extend-exclude in pyproject.toml) since it's deprecated reference-only code; other pre-commit hooks (end-of-file-fixer, trailing-whitespace) still ran on it.
  • Removes an unreachable disk-cleanup block in validate_dem_collection.py that referenced clean_ivert_files and ivert_jobs without ever importing them (ruff F821) — it would have raised a NameError the first time disk usage on an AWS server instance crossed the configured threshold.
  • Archives the now-unused ivert_jobs.py to archive/src/ (nothing in src/ivert/ imports it after the dead-code removal above).
  • Fixes the project source URL in pyproject.toml, which still pointed at the pre-transfer ciresdem/IVERT repo.

Test plan

  • ruff check . — all checks pass
  • ruff format --check . — all files formatted
  • Import smoke test of touched active modules (ivert, ivert.validate_dem_collection, ivert.cli)
  • Repo-wide grep confirms nothing references ivert_jobs outside itself before archiving

Adds a pre-commit-driven ruff format + ruff check pass across src/ivert
(E721, E402, E711/E712, E741, F401/F841, invalid escape sequences) and
whitespace/end-of-file fixes across archive/. Excludes archive/ from
ruff's linting (extend-exclude in pyproject.toml) since it's deprecated
reference-only code with a large volume of dead-code findings not worth
hand-fixing.
The block called clean_ivert_files.disk_usage_pct(), .delete_local_photon_tiles(),
.clean_cudem_cache(), and ivert_jobs.list_running_ivert_jobs() without ever
importing those names (ruff F821) — it would have crashed with a NameError
the moment disk usage on an AWS server instance exceeded the configured
threshold. Also drops the now-unused is_aws and configfile imports that
only served this block.
Nothing in src/ivert/ imports it (grep confirms only self-references
remain after the dead disk-cleanup block was removed).
Repo moved from ciresdem/IVERT to continuous-dems/ivert.
@mmacferrin
mmacferrin merged commit 41c9007 into main Jul 16, 2026
3 of 4 checks passed
@mmacferrin
mmacferrin deleted the lint-format-and-bugfixes branch July 16, 2026 20:51
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