Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Oct 9, 2024. It is now read-only.

ChartBoost/ruff-action

Repository files navigation

Warning

This repository is no longer actively maintained. It is strongly suggested that you use the officially-supported Ruff action from Astral.

ruff-action

A GitHub Action for Ruff

Ruff can now be used as a GitHub Action.

This action is commonly used as a pass/fail test to ensure your repository stays clean, abiding the 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:

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 for details

Use a different ruff version

- uses: chartboost/ruff-action@v1
 with:
 version: 0.2.2

Specify a different source directory

- uses: chartboost/ruff-action@v1
 with:
 src: './src'

Use ruff format

- uses: chartboost/ruff-action@v1
 with:
 args: 'format --check'

Only run ruff on changed files

- uses: chartboost/ruff-action@v1
 with:
 changed-files: 'true'

About

A GitHub Action for Ruff

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 11

Languages

AltStyle によって変換されたページ (->オリジナル) /