Skip to content

Support repos argument for pre-commit clean #2338

Closed

Description

@lorenzwalthert

Sometimes I have a hook env that's not working properly anymore for some reason and I don't want to clean the whole pre-commit cache. In that case, it would be handy to only clean cache for certain repos, e.g along these lines:

pre-commit clean --repos https://github.com/pre-commit/pre-commit-hooks

pre-commit clean has no such documented option and I searched old issues. Would you consider this a valuable addition?

Activity

  1. changed the title [-]Support `repos` argument for `$ pre-commit clean`[/-] [+]Support `repos` argument for `pre-commit clean`[/+] on Apr 11, 2022
  2. asottile commented on Apr 12, 2022

    @asottile
    Member

    I'm hesitant to add this option

    originally I didn't even want to implement pre-commit clean since it usually is hiding a bug somewhere else (and it trains users to run the wrong and slow things whenever something goes wrong -- "oh just make clean && make" etc.)

    I'm not really sure I want to add more features to it since that would encourage its use, thoughts?

  3. lorenzwalthert commented on May 18, 2022

    @lorenzwalthert
    ContributorAuthor

    I was also wondering about that trade-off. However, it's a reality that there are bugs in every piece of software and people need to find a way to work around them until they get solved. So I think if we properly document that people should file issues if they run into problems and use that as a strategy of last resort, I am not afraid that it will be abused. If it will, it's the responsibiliy of the user I think.

  4. asottile commented on Dec 27, 2022

    @asottile
    Member

    closing since I'm not planning to implement this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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