
Python formatting using `git cl format` has been enabled in the codebase for a while now by including a .style.yapf file in your folder hierarchy. However back in 2020 an exception was added to ignore the json schema compiler folder, as the code in there uses a lot of chained function calls that are split across lines for readability and the formatter was condensing them into a much less readable state. This CL resolves this by using the line continuation character `\` for these chained function lines, allowing us to retain the more readable indentation and also enable the formatter by default. It also runs a full format over all the files in the directory, to get them into a consistent state where we can have the formatter enabled by default going forward with low impact. No behavior change is expected. Bug: 40711753 Change-Id: I6e10dc5af022ce0e3557099a84773aa9cc92d2e4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5804254 Commit-Queue: Tim <tjudkins@chromium.org> Reviewed-by: Devlin Cronin <rdevlin.cronin@chromium.org> Cr-Commit-Position: refs/heads/main@{#1345613}
14 lines
384 B
Python
14 lines
384 B
Python
# Copyright 2012 The Chromium Authors
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
from cc_generator import CCGenerator
|
|
from h_generator import HGenerator
|
|
|
|
|
|
class CppGenerator(object):
|
|
|
|
def __init__(self, type_generator):
|
|
self.h_generator = HGenerator(type_generator)
|
|
self.cc_generator = CCGenerator(type_generator)
|