Skip to content

Feature proposal: add caching not to check unchanged files #329

Description

@asottile

In GitLab by @sobolevn on Dec 22, 2019, 04:54

Almost all linters I use have some kind of caching. It exists in

  • mypy for Python (and pytest too)
  • eslint for Javascript
  • credo for Elixir
  • rust-clippy for Rust

And only flake8 is missing this feature.

Why is it awesome? Imagine that you have a big project and lots of plugins, even big ones (like https://github.com/wemake-services/wemake-python-styleguide). It takes a LOT of time to run flake8 . on your code. Sometimes I can even ignore it locally and push directly to the CI, hoping that everything is going to be ok.

Another option is to run several changed files only manually. It is not very useful.
You can also rely on external tools like pre-commit or flakehell. Or even IDE. Which is ok, but it is kind of strange. Because looks like this should be a default behaviour. or at least a core feature.

Adding cache will allow users to rerun checks only on changed files, or when plugins are modified, or when the configuration is changed. This will significantly improve the build time.

There's already a working implementation of the caching feature in flake8 wrapper called flakehell. So, we can adapt this approach from there.
PR: life4/flakehell#33

Or come up with something different.
I can work on this during the holiday season.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions