Skip to content

Conversation

@pre-commit-ci
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

@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
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 062175b to ef66c29 Compare August 11, 2025 20:18
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from ef66c29 to 0a16183 Compare October 13, 2025 20:13
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from 0a16183 to d3476c4 Compare November 10, 2025 20:30
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v6.0.0](pre-commit/pre-commit-hooks@v4.6.0...v6.0.0)
- [github.com/asottile/pyupgrade: v3.19.1 → v3.21.2](asottile/pyupgrade@v3.19.1...v3.21.2)
@pre-commit-ci pre-commit-ci bot force-pushed the pre-commit-ci-update-config branch from d3476c4 to 0f8e568 Compare November 24, 2025 20:27
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.

3 participants