New issue
Advanced search Search tips

Issue 692752 link

Starred by 3 users

Issue metadata

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



Sign in to add a comment

git cl format needs to actually be an API

Project Member Reported by iannu...@google.com, Feb 15 2017

Issue description

Unlike `git cl presubmit` which has an API with the repo (PRESUBMIT.py files), `git cl format` is implemented by adding repo-specific things into git_cl.py (and depot_tools).

It was proposed in https://chromium-review.googlesource.com/c/437919/ that something like a FORMAT.py could exist, and `git cl format` would know how to process those FORMAT.py files in the repo. Then repo-specific formatting code could be contained and versioned with the repo.

Ideally this protocol can be VERY VERY SIMPLE (like: invoke each FORMAT.py from the file path to the root of the repo. If it returns 0, it formatted the file. If it returns 1, it doesn't know how to process the file).

If this is agreeable to folks, I'd like it if we can implement this before we add too many more things to `git cl format`.
 

Comment 1 by iannu...@google.com, Feb 15 2017

Cc: thakis@chromium.org

Comment 2 by thakis@chromium.org, Feb 15 2017

It's not chromium/src-specific, v8 and skia use it too. The current api is to find buildtools/clang-format/foo/clang-format in the repo.

But that's a technicality, and your proposal sounds like a good idea to me.

Comment 3 by iannu...@google.com, Feb 15 2017

Description: Show this description

Comment 4 by iannu...@google.com, Feb 15 2017

yeah you're right, I edited the description to clarify.
Project Member

Comment 5 by sheriffbot@chromium.org, Jul 27 2017

Labels: Hotlist-Google
Status: Available (was: Untriaged)

Sign in to add a comment