Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #19 from yosmoc/configure_check_or_format_mode
Browse files Browse the repository at this point in the history
support ruff mode argument
  • Loading branch information
brucearctor authored Mar 25, 2024
2 parents 88d6702 + 6e71569 commit 47bc082
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Ruff 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. In addition, only published versions of Ruff are supported (i.e. whatever is available on PyPI).
## 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).

### Usage
## Basic Usage
Create a file (ex: `.github/workflows/ruff.yml`) inside your repository with:

```yaml
Expand All @@ -23,24 +23,32 @@ jobs:
- uses: chartboost/ruff-action@v1
```
Alternatively,
```
- uses: chartboost/ruff-action@v1
```
can be included as a step in any other workflow file.
## 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: default, `check`
- 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:
src: "./src"
version: 0.2.2
args: --select B
```

See [Configuring Ruff](https://github.com/astral-sh/ruff/blob/main/docs/configuration.md) for details
### 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'
```

0 comments on commit 47bc082

Please sign in to comment.