Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • bazel/pre-commit
1 result
Show changes
Commits on Source (6)
## [1.0.1](https://git.gitlab.arm.com/bazel/pre-commit/compare/v1.0.0...v1.0.1) (2025-03-05)
### Bug Fixes
- **pre-commit:** validate that a runfile is resolved ([b4b8edb](https://git.gitlab.arm.com/bazel/pre-commit/commit/b4b8edba478799231fae032ba29e4a2c88fba10d))
- strip trailing Bazel module separator from workspace name ([b2457f4](https://git.gitlab.arm.com/bazel/pre-commit/commit/b2457f4410ea941b9bc3119121beb58d3879c2f9))
# 1.0.0 (2025-02-27)
### Bug Fixes
......
module(
name = "pre-commit",
version = "1.0.0",
version = "1.0.1",
compatibility_level = 1,
)
......
......@@ -555,7 +555,7 @@
"@@rules_python+//python/extensions:pip.bzl%pip": {
"general": {
"bzlTransitiveDigest": "2ZGbLzEhJiYeTL/HLcIGGr/4T4YIvqiLTBDeEGjVdFE=",
"usagesDigest": "BwyoDpM5TvSwIVe79Mj0fxoCjrWraWlVFlU+rgvY9Tc=",
"usagesDigest": "om6bHx19i4+w5Luc6l//BnYbBbXVJIPup9VRIO+TzlE=",
"recordedFileInputs": {
"@@//pre-commit/config/requirements/lock.txt": "c4df528d05090e2268c3f64b30c016de5175939606c1ebc14088f888f5d93dd0",
"@@//pre-commit/hook/requirements/lock.txt": "5f20fd61af75464158a62d2d3739cefca20d6963130c6cb37e345bcfef567424",
......
......@@ -43,9 +43,8 @@ pre_commit_hook(
pre_commit(
name = "hooks",
srcs = [":commitlint"],
# Use externally defined collection of hooks that provides `pre_commit_hooks` rule
deps = ["@pre-commit-hooks"],
srcs = [":commitlint", "@pre-commit-hooks"],
)
```
......
......@@ -305,7 +305,7 @@
"@@rules_python+//python/extensions:pip.bzl%pip": {
"general": {
"bzlTransitiveDigest": "5c6OlhUxy0VyL+VUCux9qubrei54dI8Ec5rUrxouxjY=",
"usagesDigest": "xhNTdh9Me7P3fcYm2OZC3bO+nzvZxW5TvkUj8vTVXTo=",
"usagesDigest": "ojYY40tcMHsUX2wqlEocJ602cLLQzjOy1e5p1/75x2I=",
"recordedFileInputs": {
"@@pre-commit+//pre-commit/config/requirements/lock.txt": "c4df528d05090e2268c3f64b30c016de5175939606c1ebc14088f888f5d93dd0",
"@@pre-commit+//pre-commit/hook/requirements/lock.txt": "5f20fd61af75464158a62d2d3739cefca20d6963130c6cb37e345bcfef567424",
......
......@@ -11,7 +11,7 @@ from shlex import quote, split
from shutil import copy
from sys import argv, exit
from tempfile import NamedTemporaryFile
from typing import TypeVar, TypeAlias, Protocol
from typing import Protocol, TypeAlias, TypeVar
from pre_commit.main import main
from python.runfiles import Runfiles
......@@ -44,7 +44,10 @@ def runfile(path: PurePath | str) -> Path:
path = PurePath(path)
runfiles = Runfiles.Create()
assert runfiles, "No runfile directory found."
resolved = Path(runfiles.Rlocation(str(path)))
found = runfiles.Rlocation(str(path))
if found is None:
raise RunfileNotFoundError(path)
resolved = Path(found)
if not resolved.exists():
raise RunfileNotFoundError(path)
return resolved
......
visibility("//...")
SEPARATOR = Label("@rules_python").repo_name.removesuffix("@rules_python")[-1]
def label(value):
ws = value.workspace_name
ws = value.workspace_name.removesuffix(SEPARATOR)
pkg = value.package
last = pkg.rsplit("/", 1)[-1]
name = value.name
......