Add CI lint workflow and fix all ruff lint + format errors#50
Open
austrian-code-wizard wants to merge 3 commits into
Open
Add CI lint workflow and fix all ruff lint + format errors#50austrian-code-wizard wants to merge 3 commits into
austrian-code-wizard wants to merge 3 commits into
Conversation
Co-Authored-By: Moritz Stephan <moritz.stephan@gmx.at>
Co-Authored-By: Moritz Stephan <moritz.stephan@gmx.at>
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
This PR adds a GitHub Actions CI workflow (
.github/workflows/lint.yml) that runsruff checkandruff format --checkon PRs and pushes tomain. It also fixes all pre-existing ruff lint errors and appliesruff formatacross the entire codebase so CI passes cleanly.Lint fixes applied:
setup.py,notebooks/collie_feedback_gen.ipynb,src/feedback/gpt_content.py,src/feedback/gpt_style.py,src/feedback/manual.py,src/lcdpo.py,src/train.py,tests/test_metrics.pymetric = lambda ...todef metric(...)insrc/eval.pyandsrc/train.pyfprefixes insrc/modal/app.pyandsrc/sample.pynp.random.seed(42)after all imports insrc/sample.pyelse:insrc/train.py== True/== Falsewith idiomatic assertions intests/test_metrics.pyFormatting applied (
ruff format):ruff formatto all 29 files that were not conformant — line wrapping, quote normalization, trailing commas, whitespace cleanup, etc. These are purely cosmetic changes with no semantic impact.The deliberate unused imports in
src/logger.py(originally added to test CI failure detection) have been removed as part of the fixes.Review & Testing Checklist for Human
src/eval.pyandsrc/train.pypreserve correct closure/scoping behavior (themetricfunction referencesfeedback.metricandfeedback.metric_valuefrom the enclosing scope)np.random.seed(42)being moved after all imports insrc/sample.pydoesn't change execution order in any import-time side-effect scenariolangdetect.detect,rein tests,EOS_EMOJI_REGEXin manual.py,Metricin gpt_content/gpt_style,Optionalin lcdpo,dump_arg_dictsin train,find_packagesin setup) are truly unusedruff formatchanges in the larger files (e.g.src/feedback/collie.py,src/eval.py) to confirm no unintended semantic changes crept in through line-wrapping or string reformattingTest plan: CI lint job passing is the primary validation. No runtime behavior should change — all fixes are cosmetic (unused import removal, style fixes, boolean comparison idioms, formatting).
Notes
ruff checkandruff format --checknow pass in CILink to Devin session: https://staging.itsdev.in/sessions/1ce0ad01211c45779eeb3d574e6ba972
Requested by: @austrian-code-wizard