Repository navigation
Add code quality CI (ruff, autopep8, pytest) - #56
Merged
Merged
Conversation
Mechanical cleanup ahead of the code quality CI: - autopep8 formatting (150 character lines) - remove unused imports and variables (incl. 19 leftover imports in scenariosGuide.py and two never-used st.container() placeholders) - docstring style (triple double quotes, summary on the first line, one-line docstrings) - document missing parameters; fix docstrings that named the wrong parameter (generate_eltcalc_fragment) or listed reinsurance_scope_file twice (PortfoliosEndpointInterface.create) No behaviour changes: 113 tests pass and all pages render against a live 2.5.9 platform. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mirrors OasisLMF's code-quality workflow: ruff (rules in pyproject.toml) and autopep8 --diff --exit-code at 150 characters. Ruff selects all pyflakes (F) checks, as flake8 did, plus OasisLMF's docstring rules. Also runs the pytest suite, which had no CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
6 of 7 tasks
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.
Summary
Adds a code quality CI workflow based on OasisLMF's, and fixes the existing findings so it passes.
Closes #51
CI (
.github/workflows/code-quality.yml)Runs on pull requests and pushes to
main/stable**:ruff check .— rules inpyproject.tomlautopep8 --diff --exit-code --max-line-length 150 --ignore E402— PEP8, as OasisLMFpytest(the suite had no CI before)Ruff config (
pyproject.toml) mirrors OasisLMF's docstring rules, but selects all pyflakes (F) checks rather than OasisLMF's four, matching the flake8 coverage #51 asks for. These catch undefined names — the class of bug that broke the old Dashboard page. OasisLMF's CodeQL job is not included.Cleanup (no behaviour changes)
scenariosGuide.py) and 2 unused variables (never-usedst.container()placeholders)generate_eltcalc_fragmentdocumentedvis_interfacefor a parameter namedoutput;PortfoliosEndpointInterface.createlistedreinsurance_scope_filetwice and omittedreinsurance_info_fileA short Development section in the README lists the commands to run the checks locally.
Test plan
ruff check .andautopep8 --diff --exit-codepass locallypytest— 113 passedrequirements.txtresolves cleanly from scratch (oasislmf 2.5.9)🤖 Generated with Claude Code