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)
e2e
.cache
......@@ -4,6 +4,10 @@ include:
oses:
- linux
- macos
# TODO: allow default `versions` once `--repo_contents_cache` is resolved
versions:
- 7.4.0
- 7.x
configs:
- local
......
## [1.0.8](https://git.gitlab.arm.com/bazel/pre-commit/compare/v1.0.7...v1.0.8) (2025-07-24)
### Bug Fixes
- change config yaml format ([2ac4630](https://git.gitlab.arm.com/bazel/pre-commit/commit/2ac463068c55bbdb4ae890dd58d27d3f0f599f95))
- **pre-commit:** support RUNFILES_MANIFEST_FILE ([e67c157](https://git.gitlab.arm.com/bazel/pre-commit/commit/e67c1576e73a7e0d61d3fd54bbc962d90291cdde))
## [1.0.7](https://git.gitlab.arm.com/bazel/pre-commit/compare/v1.0.6...v1.0.7) (2025-06-03)
### Bug Fixes
......
module(
name = "pre-commit",
version = "1.0.7",
version = "1.0.8",
compatibility_level = 1,
)
......
......@@ -355,6 +355,123 @@
]
}
},
"@@pybind11_bazel+//:python_configure.bzl%extension": {
"general": {
"bzlTransitiveDigest": "d4N/SZrl3ONcmzE98rcV0Fsro0iUbjNQFTIiLiGuH+k=",
"usagesDigest": "fycyB39YnXIJkfWCIXLUKJMZzANcuLy9ZE73hRucjFk=",
"recordedFileInputs": {
"@@pybind11_bazel+//MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e"
},
"recordedDirentsInputs": {},
"envVariables": {},
"generatedRepoSpecs": {
"local_config_python": {
"repoRuleId": "@@pybind11_bazel+//:python_configure.bzl%python_configure",
"attributes": {}
},
"pybind11": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"build_file": "@@pybind11_bazel+//:pybind11.BUILD",
"strip_prefix": "pybind11-2.11.1",
"urls": [
"https://github.com/pybind/pybind11/archive/v2.11.1.zip"
]
}
}
},
"recordedRepoMappingEntries": [
[
"pybind11_bazel+",
"bazel_tools",
"bazel_tools"
]
]
}
},
"@@rules_fuzzing+//fuzzing/private:extensions.bzl%non_module_dependencies": {
"general": {
"bzlTransitiveDigest": "mGiTB79hRNjmeDTQdzkpCHyzXhErMbufeAmySBt7s5s=",
"usagesDigest": "wy6ISK6UOcBEjj/mvJ/S3WeXoO67X+1llb9yPyFtPgc=",
"recordedFileInputs": {},
"recordedDirentsInputs": {},
"envVariables": {},
"generatedRepoSpecs": {
"platforms": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"urls": [
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz",
"https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz"
],
"sha256": "8150406605389ececb6da07cbcb509d5637a3ab9a24bc69b1101531367d89d74"
}
},
"rules_python": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"sha256": "d70cd72a7a4880f0000a6346253414825c19cdd40a28289bdf67b8e6480edff8",
"strip_prefix": "rules_python-0.28.0",
"url": "https://github.com/bazelbuild/rules_python/releases/download/0.28.0/rules_python-0.28.0.tar.gz"
}
},
"bazel_skylib": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"sha256": "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94",
"urls": [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz"
]
}
},
"com_google_absl": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"urls": [
"https://github.com/abseil/abseil-cpp/archive/refs/tags/20240116.1.zip"
],
"strip_prefix": "abseil-cpp-20240116.1",
"integrity": "sha256-7capMWOvWyoYbUaHF/b+I2U6XLMaHmky8KugWvfXYuk="
}
},
"rules_fuzzing_oss_fuzz": {
"repoRuleId": "@@rules_fuzzing+//fuzzing/private/oss_fuzz:repository.bzl%oss_fuzz_repository",
"attributes": {}
},
"honggfuzz": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"build_file": "@@rules_fuzzing+//:honggfuzz.BUILD",
"sha256": "6b18ba13bc1f36b7b950c72d80f19ea67fbadc0ac0bb297ec89ad91f2eaa423e",
"url": "https://github.com/google/honggfuzz/archive/2.5.zip",
"strip_prefix": "honggfuzz-2.5"
}
},
"rules_fuzzing_jazzer": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_jar",
"attributes": {
"sha256": "ee6feb569d88962d59cb59e8a31eb9d007c82683f3ebc64955fd5b96f277eec2",
"url": "https://repo1.maven.org/maven2/com/code-intelligence/jazzer/0.20.1/jazzer-0.20.1.jar"
}
},
"rules_fuzzing_jazzer_api": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_jar",
"attributes": {
"sha256": "f5a60242bc408f7fa20fccf10d6c5c5ea1fcb3c6f44642fec5af88373ae7aa1b",
"url": "https://repo1.maven.org/maven2/com/code-intelligence/jazzer-api/0.20.1/jazzer-api-0.20.1.jar"
}
}
},
"recordedRepoMappingEntries": [
[
"rules_fuzzing+",
"bazel_tools",
"bazel_tools"
]
]
}
},
"@@rules_java+//java:rules_java_deps.bzl%compatibility_proxy": {
"general": {
"bzlTransitiveDigest": "84xJEZ1jnXXwo8BXMprvBm++rRt4jsTu9liBxz0ivps=",
......@@ -540,7 +657,7 @@
"@@rules_python+//python/extensions:pip.bzl%pip": {
"general": {
"bzlTransitiveDigest": "2ZGbLzEhJiYeTL/HLcIGGr/4T4YIvqiLTBDeEGjVdFE=",
"usagesDigest": "r+ZhvTATm3bcSt5hKvH5d37SOtsBer3gYkevY+uSyv8=",
"usagesDigest": "oRzDN207wL7jV5WOpBcrHeubRFvl/yPA2inbZI9JnC0=",
"recordedFileInputs": {
"@@//pre-commit/config/requirements/lock.txt": "c4df528d05090e2268c3f64b30c016de5175939606c1ebc14088f888f5d93dd0",
"@@//pre-commit/hook/requirements/lock.txt": "5f20fd61af75464158a62d2d3739cefca20d6963130c6cb37e345bcfef567424",
......
......@@ -201,6 +201,123 @@
]
}
},
"@@pybind11_bazel+//:python_configure.bzl%extension": {
"general": {
"bzlTransitiveDigest": "d4N/SZrl3ONcmzE98rcV0Fsro0iUbjNQFTIiLiGuH+k=",
"usagesDigest": "fycyB39YnXIJkfWCIXLUKJMZzANcuLy9ZE73hRucjFk=",
"recordedFileInputs": {
"@@pybind11_bazel+//MODULE.bazel": "88af1c246226d87e65be78ed49ecd1e6f5e98648558c14ce99176da041dc378e"
},
"recordedDirentsInputs": {},
"envVariables": {},
"generatedRepoSpecs": {
"local_config_python": {
"repoRuleId": "@@pybind11_bazel+//:python_configure.bzl%python_configure",
"attributes": {}
},
"pybind11": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"build_file": "@@pybind11_bazel+//:pybind11.BUILD",
"strip_prefix": "pybind11-2.11.1",
"urls": [
"https://github.com/pybind/pybind11/archive/v2.11.1.zip"
]
}
}
},
"recordedRepoMappingEntries": [
[
"pybind11_bazel+",
"bazel_tools",
"bazel_tools"
]
]
}
},
"@@rules_fuzzing+//fuzzing/private:extensions.bzl%non_module_dependencies": {
"general": {
"bzlTransitiveDigest": "mGiTB79hRNjmeDTQdzkpCHyzXhErMbufeAmySBt7s5s=",
"usagesDigest": "wy6ISK6UOcBEjj/mvJ/S3WeXoO67X+1llb9yPyFtPgc=",
"recordedFileInputs": {},
"recordedDirentsInputs": {},
"envVariables": {},
"generatedRepoSpecs": {
"platforms": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"urls": [
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz",
"https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz"
],
"sha256": "8150406605389ececb6da07cbcb509d5637a3ab9a24bc69b1101531367d89d74"
}
},
"rules_python": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"sha256": "d70cd72a7a4880f0000a6346253414825c19cdd40a28289bdf67b8e6480edff8",
"strip_prefix": "rules_python-0.28.0",
"url": "https://github.com/bazelbuild/rules_python/releases/download/0.28.0/rules_python-0.28.0.tar.gz"
}
},
"bazel_skylib": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"sha256": "cd55a062e763b9349921f0f5db8c3933288dc8ba4f76dd9416aac68acee3cb94",
"urls": [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz"
]
}
},
"com_google_absl": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"urls": [
"https://github.com/abseil/abseil-cpp/archive/refs/tags/20240116.1.zip"
],
"strip_prefix": "abseil-cpp-20240116.1",
"integrity": "sha256-7capMWOvWyoYbUaHF/b+I2U6XLMaHmky8KugWvfXYuk="
}
},
"rules_fuzzing_oss_fuzz": {
"repoRuleId": "@@rules_fuzzing+//fuzzing/private/oss_fuzz:repository.bzl%oss_fuzz_repository",
"attributes": {}
},
"honggfuzz": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_archive",
"attributes": {
"build_file": "@@rules_fuzzing+//:honggfuzz.BUILD",
"sha256": "6b18ba13bc1f36b7b950c72d80f19ea67fbadc0ac0bb297ec89ad91f2eaa423e",
"url": "https://github.com/google/honggfuzz/archive/2.5.zip",
"strip_prefix": "honggfuzz-2.5"
}
},
"rules_fuzzing_jazzer": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_jar",
"attributes": {
"sha256": "ee6feb569d88962d59cb59e8a31eb9d007c82683f3ebc64955fd5b96f277eec2",
"url": "https://repo1.maven.org/maven2/com/code-intelligence/jazzer/0.20.1/jazzer-0.20.1.jar"
}
},
"rules_fuzzing_jazzer_api": {
"repoRuleId": "@@bazel_tools//tools/build_defs/repo:http.bzl%http_jar",
"attributes": {
"sha256": "f5a60242bc408f7fa20fccf10d6c5c5ea1fcb3c6f44642fec5af88373ae7aa1b",
"url": "https://repo1.maven.org/maven2/com/code-intelligence/jazzer-api/0.20.1/jazzer-api-0.20.1.jar"
}
}
},
"recordedRepoMappingEntries": [
[
"rules_fuzzing+",
"bazel_tools",
"bazel_tools"
]
]
}
},
"@@rules_java+//java:rules_java_deps.bzl%compatibility_proxy": {
"general": {
"bzlTransitiveDigest": "84xJEZ1jnXXwo8BXMprvBm++rRt4jsTu9liBxz0ivps=",
......@@ -290,7 +407,7 @@
"@@rules_python+//python/extensions:pip.bzl%pip": {
"general": {
"bzlTransitiveDigest": "5c6OlhUxy0VyL+VUCux9qubrei54dI8Ec5rUrxouxjY=",
"usagesDigest": "E0M6pBqiIU3FGHxwIPjycNsjKKJ3/cUlnkLDXwhFkoY=",
"usagesDigest": "XIfOig4lzQPZJBvPaJtbtHPREkMHGcWbL/F+z0nLLZg=",
"recordedFileInputs": {
"@@pre-commit+//pre-commit/config/requirements/lock.txt": "c4df528d05090e2268c3f64b30c016de5175939606c1ebc14088f888f5d93dd0",
"@@pre-commit+//pre-commit/hook/requirements/lock.txt": "5f20fd61af75464158a62d2d3739cefca20d6963130c6cb37e345bcfef567424",
......
# Regenerate with `bazel run -- //hooks:config`. Do not edit
minimum_pre_commit_version: 2.18.0
default_install_hook_types:
- pre-commit
- pre-commit
repos:
- repo: local
hooks:
- id: //pre-commit/hook/buildifier:format
name: Format Bazel files
description: Will load a `.buildifier.json` at the root of the workspace for extra
configuration.
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- //pre-commit/hook/buildifier:format
types_or:
- bazel
- id: //pre-commit/hook/buildifier:lint
name: Lint Bazel files
description: Will load a `.buildifier.json` at the root of the workspace for extra
configuration.
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- //pre-commit/hook/buildifier:lint
types_or:
- bazel
- id: //pre-commit/hook/ruff:check
name: Check Python files with `ruff`
description: Performs checks with `ruff` against Python files. Will read a `ruff.toml`
for configuration.
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- //pre-commit/hook/ruff:check
types:
- python
- id: //pre-commit/hook/ruff:format
name: Format Python files with `ruff`
description: Performs formatting with `ruff` against Python files. Will read a
`ruff.toml` for configuration.
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- //pre-commit/hook/ruff:format
types:
- python
- id: //pre-commit/hook/check-newline-at-end-of-file
name: Validate newline at the end of text files
description: Uses Python `mmap` function to efficiently load the last character
of the file and validate it is an end-of-line character (\r|\n)
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- //pre-commit/hook/check-newline-at-end-of-file
- id: //hooks:config
name: Update `pre-commit` config
description: Keeps the `.pre-commit-config.yaml` in sync with any changes to the
`pre_commit_config` rule.
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- //hooks:config
pass_filenames: false
files: ^(MODULE.bazel.lock|hooks/BUILD.bazel)$
- repo: local
hooks:
- id: //pre-commit/hook/buildifier:format
name: Format Bazel files
description: Will load a `.buildifier.json` at the root of the workspace for extra configuration.
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- //pre-commit/hook/buildifier:format
types_or:
- bazel
- id: //pre-commit/hook/buildifier:lint
name: Lint Bazel files
description: Will load a `.buildifier.json` at the root of the workspace for extra configuration.
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- //pre-commit/hook/buildifier:lint
types_or:
- bazel
- id: //pre-commit/hook/ruff:check
name: Check Python files with `ruff`
description: Performs checks with `ruff` against Python files. Will read a `ruff.toml` for configuration.
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- //pre-commit/hook/ruff:check
types:
- python
- id: //pre-commit/hook/ruff:format
name: Format Python files with `ruff`
description: Performs formatting with `ruff` against Python files. Will read a `ruff.toml` for configuration.
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- //pre-commit/hook/ruff:format
types:
- python
- id: //pre-commit/hook/check-newline-at-end-of-file
name: Validate newline at the end of text files
description: Uses Python `mmap` function to efficiently load the last character of the file and validate it is an end-of-line character (\r|\n)
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- //pre-commit/hook/check-newline-at-end-of-file
- id: //hooks:config
name: Update `pre-commit` config
description: Keeps the `.pre-commit-config.yaml` in sync with any changes to the `pre_commit_config` rule.
language: system
require_serial: true
stages:
- pre-commit
entry: bazel run --config=pre-commit -- //hooks:config
pass_filenames: false
files: ^(MODULE.bazel.lock|hooks/BUILD.bazel)$
......@@ -173,8 +173,7 @@ except KeyError:
argv.insert(1, arg)
# Patch our Bazel into the commands
bazel, *rest = runfile("pre-commit/pre-commit/bazel").glob("bazel*")
assert not rest, "extra unexpected Bazel runfiles"
bazel = runfile("pre-commit/pre-commit/bazel/bazel")
@patch("pre_commit.lang_base:hook_cmd")
......@@ -187,8 +186,7 @@ def hook_cmd(func, *k, **kw):
# Patch our `git` into `pre-commit`
git, *rest = runfile("pre-commit/pre-commit/git").glob("git*")
assert not rest, "extra unexpected `git` runfiles"
git = runfile("pre-commit/pre-commit/git/git")
@patch("pre_commit.parse_shebang:normexe")
......
......@@ -15,6 +15,7 @@ py_library(
srcs = [
"__init__.py",
"cli.py",
"dumper.py",
],
deps = [
":pyyaml",
......
......@@ -12,11 +12,7 @@ from typing import Collection, Literal, NoReturn, Protocol, TypeAlias, TypeVar
from python.runfiles import Runfiles
try:
from yaml import CSafeDumper as Dumper
except ImportError:
from yaml import SafeDumper as Dumper
from .dumper import Dumper
from ..hook import Hook, from_json, representer
......@@ -122,7 +118,7 @@ def dump(
],
}
dumper = Dumper(output, sort_keys=False)
dumper = Dumper(output)
dumper.add_representer(Hook, representer)
dumper.open()
try:
......
from yaml.emitter import Emitter
from yaml.serializer import Serializer
from yaml.representer import SafeRepresenter
from yaml.resolver import Resolver
class IndentingEmitter(Emitter):
def increase_indent(self, flow=False, indentless=False):
return super().increase_indent(flow=False, indentless=False)
class Dumper(IndentingEmitter, Serializer, SafeRepresenter, Resolver):
def __init__(self, stream, sort_keys=False):
IndentingEmitter.__init__(self, stream, width=4096)
Serializer.__init__(self)
SafeRepresenter.__init__(self, sort_keys=sort_keys)
Resolver.__init__(self)