ruff icon indicating copy to clipboard operation
ruff copied to clipboard

Allow default configuration for integrators

Open ofek opened this issue 2 years ago • 4 comments

I am integrating with Ruff and wish to provide out-of-the-box configuration that users can override if they wish. Essentially, a flag to set the extend option like --config-extend would be perfect.

My use case is a new fmt command for Hatch but I imagine others would wish to integrate in a similar way, like Visual Studio Code.

ofek avatar Nov 17 '23 04:11 ofek

Would this be easy to implement?

ofek avatar Nov 20 '23 22:11 ofek

I'm not sure about the implementation complexity and I see your use case. A related issue is that larger projects want to share some configuration across projects that may be stored in different git repositories. I started looking into this in March but have since then be busy implementing the formatter. The main idea is that you can specify a named configuration (git URL / python package name / or something else) in extend. I believe that could solve your use case too:

  • No user configuration: Pass the default configuration
  • A user configuration exists: The user should extend your base configuration

MichaReiser avatar Nov 27 '23 06:11 MichaReiser

@ofek Does https://github.com/astral-sh/ruff/pull/9599 solve your issue?

T-256 avatar Feb 13 '24 12:02 T-256

Thanks for the heads up! Unfortunately it does not work: https://github.com/astral-sh/ruff/issues/10035

ofek avatar Feb 19 '24 03:02 ofek