New issue
Advanced search Search tips

Issue 898436 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Feature



Sign in to add a comment

Make `git cl format` hookable

Project Member Reported by mathias@chromium.org, Oct 24

Issue description

V8 uses a custom DSL named Torque. Since `clang-format` only supports mainstream languages (by design), we have a separate formatter specifically for Torque: https://v8.dev/docs/torque#torque-tooling After editing a Torque file, V8 engineers have to manually run:

    tools/torque/format-torque.py -i $file

Suggestion: make `git cl format` hookable somehow, so that we can make `format-torque.py` run as needed whenever someone types `git cl format`. (Other depot_tools consumers might have similar use cases now or in the future.)

To accomplish this, `git cl format` could look for a specific file (maybe `.git-cl-format-hooks`) relative to the current repository, and if that file exists, execute it with the modified file names as arguments. Alternatively, it could look for an environment variable.

What do you think?
 
Components: -Blink>Infra Infra>SDK
Cc: ehmaldonado@chromium.org aga...@chromium.org
Labels: -Type-Bug Type-Feature
Maybe related: An attempt to run python format under git cl format globally:
https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1252408

The CL was abandoned because it was too global. But if there was a hook to enable it e.g. by project or directory, that CL could get revived.
Cc: ajp@chromium.org
Status: Available (was: Unconfirmed)
This seems like a good idea.
Labels: -Pri-3 Pri-2
Taking the liberty to bump this one to P2 as Torque usage in V8, and therefore the need for this functionality, is only going to increase.

Sign in to add a comment