Repository navigation
drop codeql, add ruff linting - #25
Merged
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
swaps codeql for a small ruff lint check.
ci
.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 touchmain.yml, which support python 3.11 through 3.14 #22 is also editingrules
ruff.tomlselects ruff's defaults: pyflakes plus basic pycodestyle errors (E4, E7, E9, F). notebooks are skipped since they're demos. config lives inruff.tomlrather thanpyproject.toml, again to stay clear of #22.what it found (24 issues, all fixed)
__init__.pyfiles re-exporting their classes: added explicit__all__instead of deleting the importslogger)las a variable name in three test comprehensions, renamed tolabeltests/conftest.pyimported theopendss_configfixture fromtests/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 conftestno behavior changes.
testing
uvx ruff@0.17.5 check .passesuv run pytest tests/gives 60 passed, 12 xfailed (same as main)