aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Haarman <inglorion@chromium.org>2023-08-11 17:36:23 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-08-14 09:25:01 +0000
commit8de83cdb69b13aaeb4acc81937bd726efd0048c7 (patch)
tree2705154e2506a0d8d58712a5832b710e83622343
parentce26592c3544c9db2e8ce10bfb0ad5016b500702 (diff)
downloadtoolchain-utils-8de83cdb69b13aaeb4acc81937bd726efd0048c7.tar.gz
pgo_rust: fix line-too-long pylint complaints
A number of lines in pgo_rust triggered line-too-long complaints from pylint. This fixes those, with the exception of one URL which happens to be longer than the line length. Shortening the URL is possible, but would make it less clear, so I've opted to instead silence the complaint for that line. BUG=None TEST=repo upload # see that cros lint no longer complains Change-Id: Ia6433eae378f66376aa33031cb3cee66e42bb69c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/4775778 Tested-by: Bob Haarman <inglorion@chromium.org> Reviewed-by: George Burgess <gbiv@chromium.org> Commit-Queue: Bob Haarman <inglorion@chromium.org>
-rwxr-xr-xpgo_tools_rust/pgo_rust.py23
1 files changed, 14 insertions, 9 deletions
diff --git a/pgo_tools_rust/pgo_rust.py b/pgo_tools_rust/pgo_rust.py
index 311caa8a..532d1ef9 100755
--- a/pgo_tools_rust/pgo_rust.py
+++ b/pgo_tools_rust/pgo_rust.py
@@ -4,6 +4,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+# pylint: disable=line-too-long
"""Handle most aspects of creating and benchmarking PGO profiles for Rust.
This is meant to be done at Rust uprev time. Ultimately profdata files need
@@ -274,9 +275,10 @@ def build_rust(
):
if use_frontend_profile or use_llvm_profile:
- assert (
- not generate_frontend_profile and not generate_llvm_profile
- ), "Can't build a compiler to both use profile information and generate it"
+ assert not generate_frontend_profile and not generate_llvm_profile, (
+ "Can't build a compiler to both use profile information "
+ "and generate it"
+ )
assert (
not generate_frontend_profile or not generate_llvm_profile
@@ -304,9 +306,9 @@ def build_rust(
def merge_profdata(llvm_or_frontend, *, source_directory: Path, dest: Path):
assert llvm_or_frontend in ("llvm", "frontend")
- # The two `llvm-profdata` programs come from different LLVM versions, and may
- # support different versions of the profdata format, so make sure to use the
- # right one.
+ # The two `llvm-profdata` programs come from different LLVM versions, and
+ # may support different versions of the profdata format, so make sure to
+ # use the right one.
llvm_profdata = (
"/usr/bin/llvm-profdata"
if llvm_or_frontend == "llvm"
@@ -586,7 +588,8 @@ def main():
parser_benchmark_nopgo.add_argument(
"--suffix",
default="",
- help="Suffix to distinguish benchmarks and profdata with identical rustc versions",
+ help="Suffix to distinguish benchmarks and profdata with identical "
+ "rustc versions",
)
parser_benchmark_pgo = subparsers.add_parser(
@@ -619,7 +622,8 @@ def main():
parser_benchmark_pgo.add_argument(
"--suffix",
default="",
- help="Suffix to distinguish benchmarks and profdata with identical rustc versions",
+ help="Suffix to distinguish benchmarks and profdata with identical "
+ "rustc versions",
)
parser_upload_profdata = subparsers.add_parser(
@@ -639,7 +643,8 @@ def main():
parser_upload_profdata.add_argument(
"--suffix",
default="",
- help="Suffix to distinguish benchmarks and profdata with identical rustc versions",
+ help="Suffix to distinguish benchmarks and profdata with identical "
+ "rustc versions",
)
args = parser.parse_args()