Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tooling] Switch from flake8 to ruff #15362

Merged
merged 8 commits into from
Jun 20, 2023
Merged

[Tooling] Switch from flake8 to ruff #15362

merged 8 commits into from
Jun 20, 2023

Commits on Jun 3, 2023

  1. Switch from flake8 to ruff:

    To quote Ruff's README: "An extremely fast Python linter, written in Rust".
    
    In my testing Ruff takes 200ms to lint the entire codebase whereas flake8
    takes about 5.5 seconds (27x slower). Running `pre-commit run -a` only takes
    about 2.3 seconds now, which should make local dev work a bit faster (assuming
    you run linters regularly).
    
    Ruff includes a lot of rules out of the box, including all the (important)
    rules from `flake8`, `flake8-bugbear`, `flake8-noqa`, and many more. Having
    all these built-in rules makes it much easier to incrementally improve the
    codebase without having to install tons of flake8 plugins.
    
    I made sure that the configs matched as close as I could get them. Some minor
    rules like line indentation and such aren't in Ruff since they are always just
    disabled. Ruff also ignores everything in the `.gitignore` file, so that cleans
    up the exclude section.
    
    Lastly, the `test-data` section seemed to have its own `.flake8` config file,
    but it was disabled in the `setup.cfg` file. I migrated the config over, but
    it doesn't really matter because it is being ignored anyways. Is this
    intentional?
    dosisod committed Jun 3, 2023
    Configuration menu
    Copy the full SHA
    0ee7349 View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2023

  1. Configuration menu
    Copy the full SHA
    df7ed7a View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2023

  1. Configuration menu
    Copy the full SHA
    fde0bf5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    26633c5 View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2023

  1. Add review suggestions

    dosisod committed Jun 19, 2023
    Configuration menu
    Copy the full SHA
    7625983 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6bc7ce8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    580c503 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2023

  1. Update pyproject.toml

    Co-authored-by: Alex Waygood <[email protected]>
    dosisod and AlexWaygood authored Jun 20, 2023
    Configuration menu
    Copy the full SHA
    925089f View commit details
    Browse the repository at this point in the history