Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ChartBoost/ruff-action
A GitHub Action for Ruff
https://github.com/ChartBoost/ruff-action
Last synced: about 2 months ago
JSON representation
A GitHub Action for Ruff
- Host: GitHub
- URL: https://github.com/ChartBoost/ruff-action
- Owner: ChartBoost
- License: apache-2.0
- Created: 2023-03-31T15:38:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-30T15:38:45.000Z (4 months ago)
- Last Synced: 2024-06-19T03:10:28.069Z (3 months ago)
- Language: Python
- Size: 31.3 KB
- Stars: 101
- Watchers: 7
- Forks: 12
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ruff-action
A GitHub Action for RuffRuff can now be used as a [GitHub Action](https://github.com/features/actions).
This action is commonly used as a pass/fail test to ensure your repository stays clean, abiding the [Rules](https://docs.astral.sh/ruff/rules/) specified in your configuration. Though it runs `ruff`, the action can do anything `ruff` can (ex, fix).
## Compatibility
This action is known to support all GitHub-hosted runner OSes. It likely can run on self-hosted runners, but might need specific dependencies. Only published versions of Ruff are supported (i.e. whatever is available on PyPI).## Basic Usage
Create a file (ex: `.github/workflows/ruff.yml`) inside your repository with:```yaml
name: Ruff
on: [push, pull_request]
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
```## Advanced Usage
The Ruff action can be customized via optional configuration parameters passed to Ruff (using `with:`):- version: Must be a Ruff release available on PyPI. By default, latest release of Ruff. You can pin a version, or use any valid version specifier.
- args: You can specify the arguments to pass to the ruff command. By default, it's `check`.
- src: default, '.'See [Configuring Ruff](https://github.com/astral-sh/ruff/blob/main/docs/configuration.md) for details
### Use a different ruff version
```yaml
- uses: chartboost/ruff-action@v1
with:
version: 0.2.2
```### Specify a different source directory
```yaml
- uses: chartboost/ruff-action@v1
with:
src: './src'
```### Use `ruff format`
```yaml
- uses: chartboost/ruff-action@v1
with:
args: 'format --check'
```### Only run ruff on changed files
```yaml
- uses: chartboost/ruff-action@v1
with:
changed-files: 'true'
```