Skip to content

[pre-commit.ci] pre-commit autoupdate #193

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pre-commit-ci[bot]
Copy link
Contributor

@pre-commit-ci pre-commit-ci bot commented Jan 27, 2025

@galou
Copy link
Collaborator

galou commented Jan 30, 2025

With pre-commit-hooks v5.0.0 and pre-commit v2.17.0, I get

An error has occurred: InvalidManifestError: 
==> File /home/gael/.cache/pre-commit/repow0clai1b/.pre-commit-hooks.yaml
==> At Hook(id='check-added-large-files')
==> At key: stages
==> At index 0
=====> Expected one of commit, commit-msg, manual, merge-commit, post-checkout, post-commit, post-merge, post-rewrite, prepare-commit-msg, push but got: 'pre-commit'
Check the log at /home/gael/.cache/pre-commit/pre-commit.log

That's the reason why I didn't upgrade. Can someone help?

@chennes
Copy link
Member

chennes commented Jan 30, 2025

I don't see anything obvious -- we are at 5.0.0 on FreeCAD Main, so it can definitely be made to work. Did you see anything in /home/gael/.cache/pre-commit/pre-commit.log?

@galou
Copy link
Collaborator

galou commented Jan 30, 2025

/home/gael/.cache/pre-commit/pre-commit.log:

### version information

`` `
pre-commit version: 2.17.0
git --version: git version 2.34.1
sys.version:
    3.10.12 (main, Jan 17 2025, 14:35:34) [GCC 11.4.0]
sys.executable: /usr/bin/python3
os.name: posix
sys.platform: linux
`` `

### error information

`` `
An error has occurred: InvalidManifestError: 
==> File /home/gael/.cache/pre-commit/repow0clai1b/.pre-commit-hooks.yaml
==> At Hook(id='check-added-large-files')
==> At key: stages
==> At index 0
=====> Expected one of commit, commit-msg, manual, merge-commit, post-checkout, post-commit, post-merge, post-rewrite, prepare-commit-msg, push but got: 'pre-commit'
`` `

`` `
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pre_commit/error_handler.py", line 70, in error_handler
    yield
  File "/usr/lib/python3/dist-packages/pre_commit/main.py", line 396, in main
    return run(args.config, store, args)
  File "/usr/lib/python3/dist-packages/pre_commit/commands/run.py", line 403, in run
    for hook in all_hooks(config, store)
  File "/usr/lib/python3/dist-packages/pre_commit/repository.py", line 228, in all_hooks
    return tuple(
  File "/usr/lib/python3/dist-packages/pre_commit/repository.py", line 231, in <genexpr>
    for hook in _repository_hooks(repo, store, root_config)
  File "/usr/lib/python3/dist-packages/pre_commit/repository.py", line 206, in _repository_hooks
    return _cloned_repository_hooks(repo_config, store, root_config)
  File "/usr/lib/python3/dist-packages/pre_commit/repository.py", line 173, in _cloned_repository_hooks
    by_id = {hook['id']: hook for hook in load_manifest(manifest_path)}
  File "/usr/lib/python3/dist-packages/cfgv.py", line 394, in load_from_filename
    with reraise_as(exc_tp):
  File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 43, in reraise_as
    raise tp(e).with_traceback(tb) from None
  File "/usr/lib/python3/dist-packages/cfgv.py", line 40, in reraise_as
    yield
  File "/usr/lib/python3/dist-packages/cfgv.py", line 398, in load_from_filename
    with validate_context(f'File {filename}'):
  File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 34, in validate_context
    raise ValidationError(e, ctx=msg).with_traceback(tb) from None
  File "/usr/lib/python3/dist-packages/cfgv.py", line 31, in validate_context
    yield
  File "/usr/lib/python3/dist-packages/cfgv.py", line 410, in load_from_filename
    validate(data, schema)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 376, in validate
    schema.check(v)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 272, in check
    validate(val, self.of)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 376, in validate
    schema.check(v)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 242, in check
    with validate_context(context):
  File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 34, in validate_context
    raise ValidationError(e, ctx=msg).with_traceback(tb) from None
  File "/usr/lib/python3/dist-packages/cfgv.py", line 31, in validate_context
    yield
  File "/usr/lib/python3/dist-packages/cfgv.py", line 244, in check
    item.check(v)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 53, in _check_optional
    with validate_context(f'At key: {self.key}'):
  File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 34, in validate_context
    raise ValidationError(e, ctx=msg).with_traceback(tb) from None
  File "/usr/lib/python3/dist-packages/cfgv.py", line 31, in validate_context
    yield
  File "/usr/lib/python3/dist-packages/cfgv.py", line 54, in _check_optional
    self.check_fn(dct[self.key])
  File "/usr/lib/python3/dist-packages/cfgv.py", line 363, in check_array_fn
    with validate_context(f'At index {i}'):
  File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 34, in validate_context
    raise ValidationError(e, ctx=msg).with_traceback(tb) from None
  File "/usr/lib/python3/dist-packages/cfgv.py", line 31, in validate_context
    yield
  File "/usr/lib/python3/dist-packages/cfgv.py", line 364, in check_array_fn
    inner_check(val)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 342, in check_one_of_fn
    raise ValidationError(
pre_commit.clientlib.InvalidManifestError: 
==> File /home/gael/.cache/pre-commit/repow0clai1b/.pre-commit-hooks.yaml
==> At Hook(id='check-added-large-files')
==> At key: stages
==> At index 0
=====> Expected one of commit, commit-msg, manual, merge-commit, post-checkout, post-commit, post-merge, post-rewrite, prepare-commit-msg, push but got: 'pre-commit'
`` `

1 similar comment
@galou
Copy link
Collaborator

galou commented Jan 30, 2025

/home/gael/.cache/pre-commit/pre-commit.log:

### version information

`` `
pre-commit version: 2.17.0
git --version: git version 2.34.1
sys.version:
    3.10.12 (main, Jan 17 2025, 14:35:34) [GCC 11.4.0]
sys.executable: /usr/bin/python3
os.name: posix
sys.platform: linux
`` `

### error information

`` `
An error has occurred: InvalidManifestError: 
==> File /home/gael/.cache/pre-commit/repow0clai1b/.pre-commit-hooks.yaml
==> At Hook(id='check-added-large-files')
==> At key: stages
==> At index 0
=====> Expected one of commit, commit-msg, manual, merge-commit, post-checkout, post-commit, post-merge, post-rewrite, prepare-commit-msg, push but got: 'pre-commit'
`` `

`` `
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pre_commit/error_handler.py", line 70, in error_handler
    yield
  File "/usr/lib/python3/dist-packages/pre_commit/main.py", line 396, in main
    return run(args.config, store, args)
  File "/usr/lib/python3/dist-packages/pre_commit/commands/run.py", line 403, in run
    for hook in all_hooks(config, store)
  File "/usr/lib/python3/dist-packages/pre_commit/repository.py", line 228, in all_hooks
    return tuple(
  File "/usr/lib/python3/dist-packages/pre_commit/repository.py", line 231, in <genexpr>
    for hook in _repository_hooks(repo, store, root_config)
  File "/usr/lib/python3/dist-packages/pre_commit/repository.py", line 206, in _repository_hooks
    return _cloned_repository_hooks(repo_config, store, root_config)
  File "/usr/lib/python3/dist-packages/pre_commit/repository.py", line 173, in _cloned_repository_hooks
    by_id = {hook['id']: hook for hook in load_manifest(manifest_path)}
  File "/usr/lib/python3/dist-packages/cfgv.py", line 394, in load_from_filename
    with reraise_as(exc_tp):
  File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 43, in reraise_as
    raise tp(e).with_traceback(tb) from None
  File "/usr/lib/python3/dist-packages/cfgv.py", line 40, in reraise_as
    yield
  File "/usr/lib/python3/dist-packages/cfgv.py", line 398, in load_from_filename
    with validate_context(f'File {filename}'):
  File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 34, in validate_context
    raise ValidationError(e, ctx=msg).with_traceback(tb) from None
  File "/usr/lib/python3/dist-packages/cfgv.py", line 31, in validate_context
    yield
  File "/usr/lib/python3/dist-packages/cfgv.py", line 410, in load_from_filename
    validate(data, schema)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 376, in validate
    schema.check(v)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 272, in check
    validate(val, self.of)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 376, in validate
    schema.check(v)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 242, in check
    with validate_context(context):
  File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 34, in validate_context
    raise ValidationError(e, ctx=msg).with_traceback(tb) from None
  File "/usr/lib/python3/dist-packages/cfgv.py", line 31, in validate_context
    yield
  File "/usr/lib/python3/dist-packages/cfgv.py", line 244, in check
    item.check(v)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 53, in _check_optional
    with validate_context(f'At key: {self.key}'):
  File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 34, in validate_context
    raise ValidationError(e, ctx=msg).with_traceback(tb) from None
  File "/usr/lib/python3/dist-packages/cfgv.py", line 31, in validate_context
    yield
  File "/usr/lib/python3/dist-packages/cfgv.py", line 54, in _check_optional
    self.check_fn(dct[self.key])
  File "/usr/lib/python3/dist-packages/cfgv.py", line 363, in check_array_fn
    with validate_context(f'At index {i}'):
  File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 34, in validate_context
    raise ValidationError(e, ctx=msg).with_traceback(tb) from None
  File "/usr/lib/python3/dist-packages/cfgv.py", line 31, in validate_context
    yield
  File "/usr/lib/python3/dist-packages/cfgv.py", line 364, in check_array_fn
    inner_check(val)
  File "/usr/lib/python3/dist-packages/cfgv.py", line 342, in check_one_of_fn
    raise ValidationError(
pre_commit.clientlib.InvalidManifestError: 
==> File /home/gael/.cache/pre-commit/repow0clai1b/.pre-commit-hooks.yaml
==> At Hook(id='check-added-large-files')
==> At key: stages
==> At index 0
=====> Expected one of commit, commit-msg, manual, merge-commit, post-checkout, post-commit, post-merge, post-rewrite, prepare-commit-msg, push but got: 'pre-commit'
`` `

@galou
Copy link
Collaborator

galou commented Jan 30, 2025

Where can I see which version of pre-commit Github is using?

@chennes
Copy link
Member

chennes commented Jan 30, 2025

Where can I see which version of pre-commit Github is using?

We can add the following to the YAML file:

- name: Check pre-commit version
  run: pre-commit --version

updates:
- [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](pre-commit/pre-commit-hooks@v4.6.0...v5.0.0)
- [github.com/asottile/pyupgrade: v3.19.1 → v3.20.0](asottile/pyupgrade@v3.19.1...v3.20.0)
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from ba78807 to 062175b Compare May 26, 2025 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants