ChartBoost / ruff-action

A GitHub Action for Ruff
Apache License 2.0
121 stars 21 forks source link

How to specify the ruff configuration file? #2

Closed wu-clan closed 1 year ago

wu-clan commented 1 year ago

Is it possible to add a with parameter: toml

to specify an existing configuration file

brucearctor commented 1 year ago

ruff picks up its config from a pyproject.toml already -- are you hoping to use a toml from a different location?

wu-clan commented 1 year ago

Yes, my ruff configuration is separate and located in .ruff.toml

brucearctor commented 1 year ago

are you sure it doesn't pick up that file? https://beta.ruff.rs/docs/configuration/#using-rufftoml looks like ruff.toml supported out of the box by ruff, which is what this project aims to do.

brucearctor commented 1 year ago

what flags/commands/arguments are you currently passing ruff for it to find your config file when you use ruff [ for example in pre-commit, or just manually on your development machine ]?

wu-clan commented 1 year ago

Sorry, ruff will automatically detect the '.ruff.toml' file locally. I am using it in pre-commit and I have ignored it here

brucearctor commented 1 year ago

so... if I understand correctly, then ruff also picks up your toml file in this gh action without problem?

wu-clan commented 1 year ago

Use args: ['--config', '.ruff.toml'] in pre-commit

Use args: '--config .ruff.toml' here

Everything works fine 🎉

brucearctor commented 1 year ago

great!

If we find this to be a significant pain point, or common use case for others, we can add an additional [ config] option in the action configuration. But, yes, that would be my first suggestion -- glad it's working for you!