Skip to content

Using ruff as a drop-in replacement for flake8 #414

@fsouza

Description

@fsouza

I'd love to be able to replace flake8 with ruff, and while most things are compatible, one current limitation is the configuration: flake8 can be configured via setup.cfg and .flake8, and at work it's a pretty common setup. Migrating everyone to pyproject.toml will likely not happen anytime soon. So I was wondering what could be done here. I thought of two options:

  1. make ruff support all flake8 flags and configuration files
    This is probably not something you'd like to have, as it becomes a layer of configuration that you don't have support for.
  2. build a "bridge" package: something that reads flake8 configuration and invokes ruff with the proper parameters (at least the supported ones)
    This can be done by a third party (I'm happy to do it), but in order to make it happen, ruff would need to support taking the configuration in some alternative mechanism (I can think of either (1) allow all settings to be defined via command line flags or (2) add a command line flag to allow the user to override the location of pyproject.toml - that way the "bridge" tool would generate the config file and invoke ruff with that flag)

Let me know if you have any thoughts!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions