Skip to content

Commit

Permalink
Update line length limit to 120 characters
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thpierce committed Jan 9, 2024
1 parent f4bb1dd commit 67db756
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions checkers/file_header_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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 = ()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tool.black]
line-length = 79
line-length = 120
exclude = '''
(
\.git
Expand Down
8 changes: 2 additions & 6 deletions scripts/check_for_valid_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 67db756

Please sign in to comment.