From 8de83cdb69b13aaeb4acc81937bd726efd0048c7 Mon Sep 17 00:00:00 2001 From: Bob Haarman Date: Fri, 11 Aug 2023 17:36:23 +0000 Subject: 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 Reviewed-by: George Burgess Commit-Queue: Bob Haarman --- pgo_tools_rust/pgo_rust.py | 23 ++++++++++++++--------- 1 file 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() -- cgit v1.2.3