Add Ruff linting, pre-commit hooks, and CI#80
Open
korbonits wants to merge 1 commit into
Open
Conversation
- Add [tool.ruff] config to pyproject.toml (E/F/I rules, line-length 120) - Add .pre-commit-config.yaml with ruff + ruff-format hooks - Add .github/workflows/lint.yml CI job via uv - Fix E101: mixed tabs/spaces in computer_use/games/tetris/workers.py Auto-fixed 276 import-sort and style violations. Remaining notes (suppressed in config): - F821: undefined names 'e' in sokoban_agent.py:578 (bare except without 'as e' binding), 'model_name_arg' in single_agent_runner.py:408,426, and 'token_limit' in tools/serving/api_manager.py:1128 — all potential NameErrors at runtime - F811: estimate_token_count redefined in tools/serving/api_providers.py:29 (import on line 19 overwritten by function definition on line 29) - E712: 19 equality comparisons to True/False across multiple files
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 Ruff linting + CI enforcement to catch style and correctness issues on every PR.
Changes:
pyproject.toml: add[tool.ruff]config (E/F/I rules, line-length 120, notebooks excluded).pre-commit-config.yaml: ruff + ruff-format hooks.github/workflows/lint.yml: lint job viauvon push/PRcomputer_use/games/tetris/workers.py: fix E101 mixed tabs/spaces (expanded tabs to 4 spaces)Auto-fixed 276 import-sort and style violations.
Items flagged for maintainer attention (suppressed in config so CI passes):
sokoban_agent.py:578: referencesebut the surroundingexceptclause has noas ebindinglmgame-bench/single_agent_runner.py:408,426: referencesmodel_name_argwhich is not defined in the enclosing scope at that pointtools/serving/api_manager.py:1128: referencestoken_limitbefore assignmentestimate_token_countimported on line 19 oftools/serving/api_providers.pythen immediately re-defined as a function on line 29; the import is deadTrue/False(e.g.if x == True:) across multiple files; useif x:insteadRuff version: v0.12.2