ruff
Ruff is an extremely fast Python linter and code formatter written in Rust.This module provides functions to run lint checks and formatting validations.
Installation
dagger install github.com/softwaredevelop/daggerverse/ruff@221a79765062ffd442a430ece86f2797c616dea1Entrypoint
Return Type
Ruff !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| image | String | - | Custom image reference in "repository:tag" format to use as a base container. |
Example
dagger -m github.com/softwaredevelop/daggerverse/ruff@221a79765062ffd442a430ece86f2797c616dea1 call \
func (m *MyModule) Example() *dagger.Ruff {
return dag.
Ruff()
}@function
def example() -> dagger.Ruff:
return (
dag.ruff()
)@func()
example(): Ruff {
return dag
.ruff()
}Types
Ruff 🔗
Ruff provides functions for running the Ruff linter and formatter.
check() 🔗
Check runs ruff check on the target directory. It supports standalone checks or using a custom ruff.toml / pyproject.toml configuration.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Source directory containing Python files or Jupyter notebooks. |
| config | File | - | Optional configuration file (ruff.toml or pyproject.toml). |
Example
dagger -m github.com/softwaredevelop/daggerverse/ruff@221a79765062ffd442a430ece86f2797c616dea1 call \
check --source DIR_PATHfunc (m *MyModule) Example(source *dagger.Directory) *dagger.Container {
return dag.
Ruff().
Check(source)
}@function
def example(source: dagger.Directory) -> dagger.Container:
return (
dag.ruff()
.check(source)
)@func()
example(source: Directory): Container {
return dag
.ruff()
.check(source)
}checkWithConfig() 🔗
CheckWithConfig runs ruff check with a configuration file. Maintained for explicit backwards compatibility.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Source directory containing Python files or Jupyter notebooks. |
| file | File ! | - | Configuration file for ruff. |
Example
dagger -m github.com/softwaredevelop/daggerverse/ruff@221a79765062ffd442a430ece86f2797c616dea1 call \
check-with-config --source DIR_PATH --file file:pathfunc (m *MyModule) Example(source *dagger.Directory, file *dagger.File) *dagger.Container {
return dag.
Ruff().
Checkwithconfig(source, file)
}@function
def example(source: dagger.Directory, file: dagger.File) -> dagger.Container:
return (
dag.ruff()
.checkwithconfig(source, file)
)@func()
example(source: Directory, file: File): Container {
return dag
.ruff()
.checkWithConfig(source, file)
}formatCheck() 🔗
FormatCheck runs ruff format –check to verify code formatting without modifying files.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Directory ! | - | Source directory containing Python files or Jupyter notebooks. |
| config | File | - | Optional configuration file (ruff.toml or pyproject.toml). |
Example
dagger -m github.com/softwaredevelop/daggerverse/ruff@221a79765062ffd442a430ece86f2797c616dea1 call \
format-check --source DIR_PATHfunc (m *MyModule) Example(source *dagger.Directory) *dagger.Container {
return dag.
Ruff().
Formatcheck(source)
}@function
def example(source: dagger.Directory) -> dagger.Container:
return (
dag.ruff()
.formatcheck(source)
)@func()
example(source: Directory): Container {
return dag
.ruff()
.formatCheck(source)
}