https://codeberg.org/adamlui/drone-ruff
214
Drone / Harness / Woodpecker plugin to run Ruff on your Python code.
.drone.yml
kind: pipeline
name: default
trigger:
event: [pull_request, push]
paths: ['**/*.{py,pyi}', '{pyproject,.ruff,ruff}.toml']
steps:
- name: ruff
image: adamlui/drone-ruff:v1.0.1
.woodpecker/ruff.yml
when:
- event: manual
- event: [pull_request, push]
path: { include: ['**/*.{py,pyi}', '{pyproject,.ruff,ruff}.toml'] }
steps:
- name: ruff
image: adamlui/drone-ruff:v1.0.1
.harness/ruff.yaml
pipeline:
stages:
- identifier: default
name: default
steps:
- identifier: ruff
name: ruff
spec:
connectorRef: account.harnessImage
image: adamlui/drone-ruff:v1.0.1
type: Plugin
Note
YAML settings override matching Ruff config file settings.
- name: ruff
image: adamlui/drone-ruff:v1.0.1
settings:
src: ./src
- name: ruff-format
image: adamlui/drone-ruff:v1.0.1
settings:
src: ./src
format: true
| Setting | Description | Default |
|---|---|---|
lint | Run ruff check (linting). | true |
format | Run ruff format (code formatting). | false |
args | Additional raw args passed verbatim to the Ruff CLI. | none |
src | Whitespace-separated list of files, directories, or glob patterns to lint/format. | . |
working_directory | Directory to run Ruff from (alias root_dir). | repo root |
| Setting | Description | Default |
|---|---|---|
output_format1 | Lint findings output format (e.g. concise, full, gitlab, json). | full |
color | Colorize findings. | true |
quiet1 | Report errors only (suppress warnings and summary). | false |
1 Unreleased — to be introduced in v1.1.0.
| Setting | Description | Default |
|---|---|---|
debug | Enable shell tracing (set -x) of the plugin entrypoint. | false |
never_fail | Exit 0 regardless of lint errors (so CI step always passes). | false |
<a target="_blank" href="https://codeberg.org/adamlui/drone-ruff/#readme">
<img height=32 alt="[Linted by drone-ruff]" src="https://img.shields.io/badge/Linted_by-drone--ruff-black?logo=drone&logoColor=white&labelColor=464646&style=for-the-badge"></a>
[![[Linted by drone-ruff]](https://img.shields.io/badge/Linted_by-drone--ruff-black?logo=drone&logoColor=white&labelColor=464646&style=for-the-badge)](https://codeberg.org/adamlui/drone-ruff/#readme)
docs/CONTRIBUTING.md to get started.main.You'll need Docker and (for local pipeline testing) the Drone CLI.
git clone https://codeberg.org/adamlui/drone-ruff.git
cd drone-ruff
The plugin is built from the Dockerfile and runs via src/entrypoint.sh + src/utils/*.sh. If you change any of these, rebuild the image:
docker build -t adamlui/drone-ruff:dev .
Run the example pipeline locally:
drone exec --pipeline default
No Drone CLI? Test the image directly:
docker run --rm -v "$PWD:/app" -w /app adamlui/drone-ruff:dev
If you find this project useful, you can support its development:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
Content type
Image
Digest
sha256:355e6a3bb…
Size
39.2 MB
Last updated
about 23 hours ago
docker pull adamlui/drone-ruff