Update README to reflect fork (#2)

This commit is contained in:
Charlie Marsh
2024-09-29 19:22:10 -04:00
committed by GitHub
parent 491342200c
commit 7388145ba9
2 changed files with 51 additions and 52 deletions
+45 -12
View File
@@ -1,15 +1,27 @@
# ruff-action
A GitHub Action for Ruff
A [GitHub Action](https://github.com/features/actions) to run
[Ruff](https://github.com/astral-sh/ruff).
Ruff can now be used as a [GitHub Action](https://github.com/features/actions).
> [!TIP] This Action is a fork of
> [chartboost/ruff-action](https://github.com/ChartBoost/ruff-action), which is
> no longer maintained. The Action is largely unchanged, but will be updated in
> a future major release.
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).
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).
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](https://pypi.org/project/ruff/)).
## Basic Usage
Create a file (ex: `.github/workflows/ruff.yml`) inside your repository with:
```yaml
@@ -24,15 +36,23 @@ jobs:
```
## 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, '.'
The Ruff action can be customized via optional configuration parameters passed
to Ruff (using `with:`):
See [Configuring Ruff](https://github.com/astral-sh/ruff/blob/main/docs/configuration.md) for details
- `version`: Must be a Ruff release available on
[PyPI](https://pypi.org/project/ruff/). Defaults to the latest Ruff release.
You can pin a version, or use any valid version specifier.
- `args`: The arguments to pass to the `ruff` command. Defaults to `check`,
which lints the current directory.
- `src`: The directory to run `ruff` in. Defaults to the root of the repository.
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:
@@ -40,22 +60,35 @@ See [Configuring Ruff](https://github.com/astral-sh/ruff/blob/main/docs/configur
```
### Specify a different source directory
```yaml
- uses: chartboost/ruff-action@v1
with:
src: './src'
src: "./src"
```
### Use `ruff format`
```yaml
- uses: chartboost/ruff-action@v1
with:
args: 'format --check'
args: "format --check"
```
### Only run ruff on changed files
```yaml
- uses: chartboost/ruff-action@v1
with:
changed-files: 'true'
changed-files: "true"
```
## License
Apache
<div align="center">
<a target="_blank" href="https://astral.sh" style="background:none">
<img src="https://raw.githubusercontent.com/astral-sh/uv/main/assets/svg/Astral.svg" alt="Made by Astral">
</a>
</div>