FreeCAD-macros icon indicating copy to clipboard operation
FreeCAD-macros copied to clipboard

[pre-commit.ci] pre-commit autoupdate

Open pre-commit-ci[bot] opened this issue 1 year ago • 6 comments

updates:

pre-commit-ci[bot] avatar Jan 27 '25 22:01 pre-commit-ci[bot]

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?

galou avatar Jan 30 '25 13:01 galou

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?

chennes avatar Jan 30 '25 13:01 chennes

/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 avatar Jan 30 '25 14:01 galou

/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 avatar Jan 30 '25 14:01 galou

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

galou avatar Jan 30 '25 14:01 galou

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

chennes avatar Jan 30 '25 16:01 chennes