Check and fix mock names in pre-commit hook - #464
Open
cameron-craig-etas wants to merge 8 commits into
Open
Conversation
cameron-craig-etas
requested a deployment
to
workflow-approval
August 13, 2026 13:05 — with
GitHub Actions
Waiting
cameron-craig-etas
requested a deployment
to
workflow-approval
August 13, 2026 13:05 — with
GitHub Actions
Waiting
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //:license-checkStatus: Click to expand output |
|
The created documentation from the pull request is available at: docu-html |
added 2 commits
August 13, 2026 14:50
cameron-craig-etas
requested a deployment
to
workflow-approval
August 13, 2026 14:02 — with
GitHub Actions
Waiting
cameron-craig-etas
requested a deployment
to
workflow-approval
August 13, 2026 14:02 — with
GitHub Actions
Waiting
cameron-craig-etas
requested a deployment
to
workflow-approval
August 13, 2026 14:09 — with
GitHub Actions
Waiting
cameron-craig-etas
requested a deployment
to
workflow-approval
August 13, 2026 14:09 — with
GitHub Actions
Waiting
cameron-craig-etas
marked this pull request as ready for review
August 14, 2026 07:05
cameron-craig-etas
requested review from
FScholPer,
MaciejKaszynski,
NicolasFussberger,
anmittag,
antonkri,
pawelrutkaq and
ramceb
as code owners
August 14, 2026 07:05
MaciejKaszynski
requested changes
Aug 14, 2026
MaciejKaszynski
left a comment
Contributor
There was a problem hiding this comment.
Mostly nit picks
cameron-craig-etas
requested a deployment
to
workflow-approval
August 14, 2026 08:26 — with
GitHub Actions
Waiting
cameron-craig-etas
requested a deployment
to
workflow-approval
August 14, 2026 08:26 — with
GitHub Actions
Waiting
MaciejKaszynski
approved these changes
Aug 14, 2026
danth
reviewed
Aug 14, 2026
| base = re.sub(rf"(?i)(^|[_-]){double_name}($|[_-])", r"\1\3", old_name, count=1) | ||
| # Collapse any doubled-up separator left behind (e.g. "foo__bar") and | ||
| # trim a leading/trailing one (e.g. from "mock_foo" or "foo_mock"). | ||
| base = re.sub(r"[_-]{2,}", "_", base) |
Member
There was a problem hiding this comment.
This will replace dashes with underscores, seems unintended since the rest of the code preserves dashes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#422
This PR adds a Python script to validate test doubles (mocks, stubs, fakes etc.), to ensure they use the test double name as a prefix (e.g
mock_component.cpp). We recently updated all our mocks to use a consistent format (/pull/457). This pre-commit will keep things nice and tidy 🧹As far as testing goes I have ran through these scenarios manually: