Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

ci(ruff): add lightweight lint + pre-commit

Wang Siyuan67e8df7c41df
diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml
new file mode 100644
index 000000000..234d49bad
--- /dev/null
+++ b/.github/workflows/lint.yml
@@ -0,0 +1,24 @@
+name: lint
+
+on:
+ pull_request:
+ push:
+ branches:
+ - master
+
+jobs:
+ ruff:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-python@v5
+ with:
+ python-version: '3.12'
+ - name: Install uv
+ run: pip install uv
+ - name: Install deps
+ run: uv sync --no-dev
+ - name: Run pre-commit (ruff)
+ run: |
+ pip install pre-commit
+ pre-commit run --all-files
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
new file mode 100644
index 000000000..d58f56707
--- /dev/null
+++ b/.pre-commit-config.yaml
@@ -0,0 +1,6 @@
+repos:
+ - repo: https://github.com/astral-sh/ruff-pre-commit
+ rev: v0.4.9
+ hooks:
+ - id: ruff
+ args: ["--config=pyproject.toml"]
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index f86f3f6c4..bc3665829 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -11,7 +11,7 @@ Thanks for your interest in contributing!
## Development
- Run locally: `python main.py`
-- Lint before PR (add your linter if used)
+- Lint before PR: ruff is configured with a minimal safety rule set (E9,F63,F7,F82) and ignores E501. Install hooks with `pip install pre-commit` then `pre-commit install`. Run manually with `pre-commit run --all-files`.
- Write clear commit messages
- Agent-specific changes: install the relevant CLI (recommended: OpenCode `opencode`; also supported: Codex), then route one Slack channel via Slack **Agent Settings** to manually test the backend (`opencode` or `codex`).
diff --git a/docs/plans/ci-ruff-precommit.md b/docs/plans/ci-ruff-precommit.md
new file mode 100644
index 000000000..bfd5fb34e
--- /dev/null
+++ b/docs/plans/ci-ruff-precommit.md
@@ -0,0 +1,22 @@
+# CI lint & pre-commit (ruff)
+
+## Background
+- CONTRIBUTING asks for lint before PR, but repo has no linter config or CI enforcement.
+- We saw ruff available (`ruff 0.14.4`) and minimal safety rule set (`E9,F63,F7,F82`) already passes; broader E/F has many legacy hits, so we’ll start small to avoid churn.
+
+## Goal
+- Add lightweight CI + pre-commit using ruff to catch syntax/undefined-name issues, with shared config and line length at 120. Ignore E501 for now to avoid reflowing legacy lines.
+
+## Plan
+- Add `[tool.ruff]` config (line length 120, src `.`) and lint select `E9,F63,F7,F82`, extend-ignore `E501`.
+- Add `.pre-commit-config.yaml` with ruff check hook using shared config.
+- Add GitHub Actions workflow `lint.yml` running `pre-commit run --all-files` on PRs/push to master.
+- Update CONTRIBUTING.md with quick-start (install pre-commit, run hooks) and note the limited rule scope.
+- Run hooks locally to confirm green.
+
+## Todo
+- [x] Update pyproject with ruff config
+- [x] Add pre-commit config
+- [x] Add lint GitHub Action
+- [x] Update CONTRIBUTING
+- [ ] Run pre-commit --all-files
diff --git a/pyproject.toml b/pyproject.toml
index e748c934e..3f7fa7720 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -75,3 +75,11 @@ include = [
"README.md",
"LICENSE",
]
+
+[tool.ruff]
+line-length = 120
+src = ["."]
+
+[tool.ruff.lint]
+select = ["E9", "F63", "F7", "F82"]
+extend-ignore = ["E501"]