Skip to content

drop codeql, add ruff linting - #25

Merged
davebiagioni merged 1 commit into
mainfrom
ci-ruff-drop-codeql
Nov 15, 2026
Merged

davebiagioni merged 1 commit into
mainfrom
ci-ruff-drop-codeql

Conversation

@davebiagioni

Copy link
Copy Markdown
Collaborator

swaps codeql for a small ruff lint check.

ci

  • removes the codeql workflow and its readme badge
  • adds .github/workflows/lint.yml, which runs ruff (pinned to 0.17.5) on pushes and prs to main. it's a separate workflow so it doesn't touch main.yml, which support python 3.11 through 3.14 #22 is also editing
  • points both readme badges at the NatLabRockies org

rules

ruff.toml selects ruff's defaults: pyflakes plus basic pycodestyle errors (E4, E7, E9, F). notebooks are skipped since they're demos. config lives in ruff.toml rather than pyproject.toml, again to stay clear of #22.

what it found (24 issues, all fixed)

  • package __init__.py files re-exporting their classes: added explicit __all__ instead of deleting the imports
  • dead imports in a handful of modules (mostly an unused logger)
  • an f-string with no placeholders
  • l as a variable name in three test comprehensions, renamed to label
  • tests/conftest.py imported the opendss_config fixture from tests/distribution_system/conftest.py. that works, but ruff flags it as unused-then-redefined. moved the fixture into the root conftest, where every test dir can see it, and deleted the now-empty subdir conftest

no behavior changes.

testing

- remove the codeql workflow and its readme badge
- new lint workflow runs ruff (pinned 0.17.5) on pushes and prs to main
- ruff.toml selects ruff's default rules (pyflakes + basic pycodestyle
  errors) and skips notebooks
- fix what it found: unused imports, explicit __all__ for package
  re-exports, an f-string with no placeholders, ambiguous 'l' names in tests
- move the opendss_config fixture into tests/conftest.py; it was being
  imported from a subdirectory conftest, which ruff rightly flags
@davebiagioni
davebiagioni merged commit f2ee4d1 into main Nov 15, 2026
2 checks passed
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