From 67db756f6cde278df3a7246829b11a22858913a9 Mon Sep 17 00:00:00 2001 From: Thomas Pierce Date: Tue, 9 Jan 2024 11:33:15 -0800 Subject: [PATCH] Update line length limit to 120 characters 79 characters was very agressive and decreased readability. Increase to 120 for a more modern limit. Also applied the linter with python scripts/eachdist.py lint. --- .isort.cfg | 2 +- .pylintrc | 2 +- checkers/file_header_checker.py | 8 ++------ .../distro/test_aws_opentelementry_configurator.py | 5 +---- pyproject.toml | 2 +- scripts/check_for_valid_readme.py | 8 ++------ 6 files changed, 8 insertions(+), 19 deletions(-) diff --git a/.isort.cfg b/.isort.cfg index a64b63937..65861ec45 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -2,7 +2,7 @@ include_trailing_comma=True force_grid_wrap=0 use_parentheses=True -line_length=79 +line_length=120 profile=black ; 3 stands for Vertical Hanging Indent, e.g. diff --git a/.pylintrc b/.pylintrc index 30f64f97a..014d26c10 100644 --- a/.pylintrc +++ b/.pylintrc @@ -264,7 +264,7 @@ indent-after-paren=4 indent-string=' ' # Maximum number of characters on a single line. -max-line-length=79 +max-line-length=120 # Maximum number of lines in a module. max-module-lines=1000 diff --git a/checkers/file_header_checker.py b/checkers/file_header_checker.py index f2d1da65c..21ae1a676 100644 --- a/checkers/file_header_checker.py +++ b/checkers/file_header_checker.py @@ -3,9 +3,7 @@ from pylint.checkers import BaseRawFileChecker -COPYWRITE_STRING = ( - "# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n" -) +COPYWRITE_STRING = "# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n" COPYWRITE_BYTES = bytes(COPYWRITE_STRING, "utf-8") LICENSE_STRING = "# SPDX-License-Identifier: Apache-2.0" LICENSE_BYTES = bytes(LICENSE_STRING, "utf-8") @@ -17,9 +15,7 @@ class FileHeaderChecker(BaseRawFileChecker): "E1234": ( "File has missing or malformed header", "missing-header", - "All files must have required header: \n" - + COPYWRITE_STRING - + LICENSE_STRING, + "All files must have required header: \n" + COPYWRITE_STRING + LICENSE_STRING, ), } options = () diff --git a/opentelemetry-distro/tests/amazon/opentelemetry/distro/test_aws_opentelementry_configurator.py b/opentelemetry-distro/tests/amazon/opentelemetry/distro/test_aws_opentelementry_configurator.py index aa474928b..f96c3edcb 100644 --- a/opentelemetry-distro/tests/amazon/opentelemetry/distro/test_aws_opentelementry_configurator.py +++ b/opentelemetry-distro/tests/amazon/opentelemetry/distro/test_aws_opentelementry_configurator.py @@ -3,10 +3,7 @@ from unittest import TestCase -from opentelemetry.distro.aws_opentelemetry_configurator import ( - AwsOpenTelemetryConfigurator, - AwsTracerProvider, -) +from opentelemetry.distro.aws_opentelemetry_configurator import AwsOpenTelemetryConfigurator, AwsTracerProvider class TestAwsOpenTelemetryConfigurator(TestCase): diff --git a/pyproject.toml b/pyproject.toml index c1a64c524..c89e9c734 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.black] -line-length = 79 +line-length = 120 exclude = ''' ( \.git diff --git a/scripts/check_for_valid_readme.py b/scripts/check_for_valid_readme.py index c84b309ae..29c9ab381 100644 --- a/scripts/check_for_valid_readme.py +++ b/scripts/check_for_valid_readme.py @@ -16,12 +16,8 @@ def is_valid_rst(path): def parse_args(): - parser = argparse.ArgumentParser( - description="Checks README.rst file in path for syntax errors." - ) - parser.add_argument( - "paths", nargs="+", help="paths containing a README.rst to test" - ) + parser = argparse.ArgumentParser(description="Checks README.rst file in path for syntax errors.") + parser.add_argument("paths", nargs="+", help="paths containing a README.rst to test") parser.add_argument("-v", "--verbose", action="store_true") return parser.parse_args()