# Copyright (c) 2022 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. All contributing project authors may # be found in the AUTHORS file in the root of the source tree.
import difflib import os import shlex
# Runs PRESUBMIT.py in py3 mode by git cl presubmit.
USE_PYTHON3 = True
# Make sure NewContents reads the updated files from disk and not cache.
new_content = f.NewContents(flush_cache=True) if new_content != prev_content:
path = f.LocalPath()
diff = difflib.unified_diff(prev_content, new_content, path, path, lineterm='')
diffs.append('\n'.join(diff))
if diffs:
combined_diffs = '\n'.join(diffs)
msg = ( 'Diff found after running "yapf -i" on modified .pyl files:\n\n'
f'{combined_diffs}\n\n' 'Please commit or discard the new changes.'
)
results.append(output_api.PresubmitError(msg))
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.