Skip to content

Need a .pre-commit-config.yaml to meet Contributing Guidelines recommendation #415

@chickenandpork

Description

@chickenandpork

In submitting a PR, since this is my first, the act of reviewing the diff on GitHub suggests I check out the commit guidelines (https://github.com/bazel-contrib/.github/blob/c9d6d1893b10a8d68584a6ba52c3dd35506486d0/CONTRIBUTING.md). This seems to be a cross-org guideline simply recommending a basic pre-commit install.

Without the --allow-missing, this would require a .pre-commit-config.yaml to be checked-in at the workspace directory. I don't see one in the directory.

We likely need to add one: copying https://github.com/bazel-contrib/rules_cuda/blob/main/.pre-commit-config.yaml may suffice. Other repos in bazel-contrib seem to lack this config file.

Granted, the error appears because I didn't see a .pre-commit-config.yaml, so didn't install. Having run the command, I then run a pre-commit run -a, ant that produced the error:

Allans-MBP2019:rules_bazel_integration_test allanc$ pre-commit install
pre-commit installed at .git/hooks/pre-commit
Allans-MBP2019:rules_bazel_integration_test allanc$ pre-commit run -a
An error has occurred: InvalidConfigError: 
=====> .pre-commit-config.yaml is not a file
Check the log at /Users/allanc/.cache/pre-commit/pre-commit.log

That log file follows.

version information

pre-commit version: 3.0.4
git --version: git version 2.39.5 (Apple Git-154)
sys.version:
    3.9.6 (default, Oct  4 2024, 08:01:32) 
    [Clang 16.0.0 (clang-1600.0.26.4)]
sys.executable: /Library/Developer/CommandLineTools/usr/bin/python3
os.name: posix
sys.platform: darwin

error information

An error has occurred: InvalidConfigError: 
=====> .pre-commit-config.yaml is not a file
Traceback (most recent call last):
  File "/Library/Python/3.9/site-packages/pre_commit/error_handler.py", line 73, in error_handler
    yield
  File "/Library/Python/3.9/site-packages/pre_commit/main.py", line 394, in main
    return run(args.config, store, args)
  File "/Library/Python/3.9/site-packages/pre_commit/commands/run.py", line 417, in run
    config = load_config(config_file)
  File "/Library/Python/3.9/site-packages/cfgv.py", line 411, in load_from_filename
    return apply_defaults(data, schema)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/contextlib.py", line 135, in __exit__
    self.gen.throw(type, value, traceback)
  File "/Library/Python/3.9/site-packages/cfgv.py", line 43, in reraise_as
    raise tp(e).with_traceback(tb) from None
  File "/Library/Python/3.9/site-packages/cfgv.py", line 40, in reraise_as
    yield
  File "/Library/Python/3.9/site-packages/cfgv.py", line 396, in load_from_filename
    raise ValidationError(f'{filename} is not a file')
pre_commit.clientlib.InvalidConfigError: 
=====> .pre-commit-config.yaml is not a file

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