Skip to content

more clarity for pre-commit autoupdate --repos #3695

Closed

Description

@mxr

search you tried in the issue tracker

autoupdate silent

describe your actual problem

pre-commit autoupdate --repos matches against the passed-in repos here:

if not repos or repo['repo'] in repos

If no repos match, then no futures are created, so the command exits silently.

$ pre-commit autoupdate --repo https://github.com/pre-commit/pre-comimt-hooks
# exits with 0 and prints nothing

Wondering if it would be clearer to log which passed-in repos don't match any repos in the pre-commit config to make this easier to debug.

pre-commit --version

pre-commit 4.6.0

Activity

  1. asottile commented on May 19, 2026

    @asottile
    Member

    it might (?) be better -- though the usual program usually outputs something on success anyway

  2. mxr commented on May 19, 2026

    @mxr
    MemberAuthor

    To be precise it prints out a log line for each future only.

    $ pre-commit autoupdate --freeze --repo https://github.com/zizmorcore/zizmor-pre-commit --repo https://github.com/sqlfluff/sqlfluff --repo https://github.com/pre-commit/pre-commit-hooks --repo doesnotexist
    [https://github.com/pre-commit/pre-commit-hooks] already up to date!
    [https://github.com/sqlfluff/sqlfluff] updating ec5ed61d83ae336c65c4c15396a23772ce9d2fcc -> 4.2.1 (frozen)
    [https://github.com/zizmorcore/zizmor-pre-commit] updating a4727cbbcd26d7098e96b9cb738169b59711ae51 -> v1.25.2 (frozen)

    (doesnotexist has no output since no future is created)

  3. changed the title [-]more clarity for `pre-commot autoupdate --repos`[/-] [+]more clarity for `pre-commit autoupdate --repos`[/+] on May 19, 2026
  4. asottile commented on May 28, 2026

    @asottile
    Member

    slept on this and I think the following should happen (yeah technically a breaking change but tbh it's just an oversight that this was allowed to pass)

    any specified --repo that doesn't match any in the config should be an error

  5. mxr commented on May 28, 2026

    @mxr
    MemberAuthor

    sg I opened a PR to log a warning (in the short-term) and another PR to return an error (for 6-12 months later?)

  6. asottile commented on May 29, 2026

    @asottile
    Member

    I'm fine to just go straight to error

  7. mxr commented on May 30, 2026

    @mxr
    MemberAuthor

    sure

  8. asottile commented on Jul 21, 2026

    @asottile
    Member

    via #3701

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