feat: add Woodpecker CI pipeline and ruff config #2

Merged
forgejo_admin merged 1 commit from 1-add-woodpecker-ci-pipeline-ruff-config-f into main 2026-03-01 17:32:11 +00:00
Contributor

Summary

  • Add Woodpecker CI pipeline with lint (ruff==0.15.2) and publish steps for Forgejo PyPI registry
  • Add ruff configuration to pyproject.toml (py310, line-length 120, select E/F/W/I)
  • Fix all lint and format issues across source files

Changes

  • .woodpecker.yml: New CI pipeline with lint step (ruff check + format --check) and publish step (build + twine upload to Forgejo PyPI, main-only). Test step omitted because repo has no tests yet (only empty tests/__init__.py).
  • pyproject.toml: Added [tool.ruff] (target-version py310, line-length 120), [tool.ruff.lint] (select E/F/W/I), and ruff>=0.15.0 to [dev] extras.
  • src/forgejo_mcp/server.py: Import ordering fixed by ruff (isort).
  • src/forgejo_mcp/tools/workflows.py: Fixed 3 long lines (E501) by wrapping strings, ruff reformatted json.dumps calls and function signatures for consistency.

Test Plan

  • ruff check src/ passes with zero errors
  • ruff format --check src/ confirms all files formatted
  • Woodpecker pipeline runs successfully on PR (lint step)
  • Publish step triggers on merge to main

Review Checklist

  • No secrets committed
  • No unnecessary file changes
  • Commit message is descriptive
  • Ruff pinned to 0.15.2 in CI lint step
  • Publish step restricted to push events on main branch
  • plan-2026-03-01-forgejo-pypi-migration -- Phase 1, forgejo-mcp repo
  • Closes #1
## Summary - Add Woodpecker CI pipeline with lint (ruff==0.15.2) and publish steps for Forgejo PyPI registry - Add ruff configuration to pyproject.toml (py310, line-length 120, select E/F/W/I) - Fix all lint and format issues across source files ## Changes - `.woodpecker.yml`: New CI pipeline with lint step (ruff check + format --check) and publish step (build + twine upload to Forgejo PyPI, main-only). Test step omitted because repo has no tests yet (only empty `tests/__init__.py`). - `pyproject.toml`: Added `[tool.ruff]` (target-version py310, line-length 120), `[tool.ruff.lint]` (select E/F/W/I), and `ruff>=0.15.0` to `[dev]` extras. - `src/forgejo_mcp/server.py`: Import ordering fixed by ruff (isort). - `src/forgejo_mcp/tools/workflows.py`: Fixed 3 long lines (E501) by wrapping strings, ruff reformatted `json.dumps` calls and function signatures for consistency. ## Test Plan - [x] `ruff check src/` passes with zero errors - [x] `ruff format --check src/` confirms all files formatted - [ ] Woodpecker pipeline runs successfully on PR (lint step) - [ ] Publish step triggers on merge to main ## Review Checklist - [x] No secrets committed - [x] No unnecessary file changes - [x] Commit message is descriptive - [x] Ruff pinned to 0.15.2 in CI lint step - [x] Publish step restricted to push events on main branch ## Related Notes - `plan-2026-03-01-forgejo-pypi-migration` -- Phase 1, forgejo-mcp repo - Closes #1
Add .woodpecker.yml with lint and publish steps (no test step since
repo has no tests yet). Add [tool.ruff] config to pyproject.toml
(py310, line-length 120, E/F/W/I). Add ruff to dev extras. Fix all
lint and format issues across source files.

Closes #1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
Contributor

PR #2 Review

BLOCKERS

None.

NITS

  1. Lint step only covers src/ -- The woodpecker-sdk reference lints both src/ tests/. This PR lints only src/. The justification (repo has no tests, only empty tests/__init__.py) is reasonable, but if tests are added later someone will need to remember to update the lint targets. Consider adding tests/ now for consistency with the template, even if it is currently empty. Non-blocking.

SOP COMPLIANCE

  • Branch named after issue (1-add-woodpecker-ci-pipeline-ruff-config-f references issue #1)
  • PR body follows template-pr-body (Summary, Changes, Test Plan, Review Checklist, Related Notes)
  • Related Notes references plan-2026-03-01-forgejo-pypi-migration
  • Test step omitted per plan decision (repo has no tests)
  • No secrets, .env files, or credentials committed
  • No unnecessary file changes (4 files, all in scope)
  • Commit messages are descriptive

PIPELINE VERIFICATION

  • .woodpecker.yml matches proven pattern from woodpecker-sdk
  • ruff==0.15.2 pinned in lint step
  • Ruff config: py310, line-length 120, select E/F/W/I
  • Publish step uses $$FORGEJO_PYPI_URL, $$FORGEJO_PUBLISH_USER, $$FORGEJO_PUBLISH_TOKEN with from_secret
  • --non-interactive flag on twine upload
  • Publish restricted to event: push, branch: main

CODE CHANGES

  • server.py import reorder is mechanical (isort)
  • workflows.py changes are all mechanical formatting (E501 line wraps, json.dumps reformatting, function signature reformatting) -- no behavioral changes

VERDICT: APPROVED

## PR #2 Review ### BLOCKERS None. ### NITS 1. **Lint step only covers `src/`** -- The woodpecker-sdk reference lints both `src/ tests/`. This PR lints only `src/`. The justification (repo has no tests, only empty `tests/__init__.py`) is reasonable, but if tests are added later someone will need to remember to update the lint targets. Consider adding `tests/` now for consistency with the template, even if it is currently empty. Non-blocking. ### SOP COMPLIANCE - [x] Branch named after issue (`1-add-woodpecker-ci-pipeline-ruff-config-f` references issue #1) - [x] PR body follows `template-pr-body` (Summary, Changes, Test Plan, Review Checklist, Related Notes) - [x] Related Notes references `plan-2026-03-01-forgejo-pypi-migration` - [x] Test step omitted per plan decision (repo has no tests) - [x] No secrets, .env files, or credentials committed - [x] No unnecessary file changes (4 files, all in scope) - [x] Commit messages are descriptive ### PIPELINE VERIFICATION - [x] `.woodpecker.yml` matches proven pattern from woodpecker-sdk - [x] `ruff==0.15.2` pinned in lint step - [x] Ruff config: py310, line-length 120, select E/F/W/I - [x] Publish step uses `$$FORGEJO_PYPI_URL`, `$$FORGEJO_PUBLISH_USER`, `$$FORGEJO_PUBLISH_TOKEN` with `from_secret` - [x] `--non-interactive` flag on twine upload - [x] Publish restricted to `event: push, branch: main` ### CODE CHANGES - [x] `server.py` import reorder is mechanical (isort) - [x] `workflows.py` changes are all mechanical formatting (E501 line wraps, `json.dumps` reformatting, function signature reformatting) -- no behavioral changes ### VERDICT: APPROVED
forgejo_admin deleted branch 1-add-woodpecker-ci-pipeline-ruff-config-f 2026-03-01 17:32:11 +00:00
Sign in to join this conversation.
No description provided.