Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update builtin docformatter to 1.7.5 #20498

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build-support/bin/generate_completions.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def _run_pants_help():


def _parse_help_for_options(help: dict, scope: str) -> tuple[frozenset[str], frozenset[str]]:
"""scope represents the goal or subsystem of interest Returns a tuple containing the scoped
"""Scope represents the goal or subsystem of interest Returns a tuple containing the scoped
options, followed by unscoped."""
scoped_help_info = help["scope_to_help_info"][scope]

Expand Down
4 changes: 2 additions & 2 deletions build-support/bin/generate_json_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ def get_default(option: dict) -> Any:
"""Get default value for an option.
Ensure options that depend on any machine specific environment are properly handled. E.g.
`"default": "<buildroot>/.pants.d"` will be expanded to the `"default": "/home/your-user.name/code/pants/.pants.d"`
which is not what we want to have in a public schema.
`"default": "<buildroot>/.pants.d"` will be expanded to the `"default": "/home/your-
user.name/code/pants/.pants.d"` which is not what we want to have in a public schema.
"""
return ENV_SPECIFIC_OPTION_DEFAULTS.get(option["config_key"], option["default"])

Expand Down
8 changes: 4 additions & 4 deletions build-support/bin/terraform_tool_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# Licensed under the Apache License, Version 2.0 (see LICENSE).
"""Fetch versions of Terraform and format them for use in known_versions.
The main version page lists the available versions in descending order.
It includes stable releases but also various levels of pre-release.
The main version page lists the available versions in descending order. It includes stable releases
but also various levels of pre-release.
Each version links to a version-specific page.
This page includes links to download the binary, sha256sum file, and a signature of the sha256sum file.
Each version links to a version-specific page. This page includes links to download the binary,
sha256sum file, and a signature of the sha256sum file.
"""

import csv
Expand Down
8 changes: 4 additions & 4 deletions build-support/migration-support/fix_deprecated_globs_usage.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python3
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

"""A script to replace deprecated uses of `globs`, `rglobs`, and `zglobs` in BUILD files with a
direct list of files and globs.

Expand Down Expand Up @@ -77,10 +76,11 @@ class GlobFunction(NamedTuple):
def normalize_rglob(rglob: str) -> str:
"""We must expand rglobs for them to work properly.

In rglobs, * at the beginning of a path component means "any number of directories, including 0".
So every time we see ^*, we need to output "**/*whatever".
In rglobs, * at the beginning of a path component means "any number of directories,
including 0". So every time we see ^*, we need to output "**/*whatever".

See https://github.com/pantsbuild/pants/blob/9832c8f6d8b60648cf906775506864aad0ffdb33/src/python/pants/source/wrapped_globs.py#L303
See
https://github.com/pantsbuild/pants/blob/9832c8f6d8b60648cf906775506864aad0ffdb33/src/python/pants/source/wrapped_globs.py#L303
for the original implementation.
"""
components = rglob.split(os.path.sep)
Expand Down
1 change: 0 additions & 1 deletion build-support/migration-support/migrate_to_toml_config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python3
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

"""A script to automatically convert an INI Pants config file to TOML. There will still likely be
some issues remaining which require manual fixes, but this script will automate most of the tedium.
Expand Down
1 change: 0 additions & 1 deletion src/python/pants/backend/awslambda/python/register.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

"""Create AWS Lambdas from Python code.
See https://www.pantsbuild.org/docs/awslambda-python.
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/cc/lint/clangformat/subsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ClangFormat(PythonToolBase):
default_lockfile_resource = ("pants.backend.cc.lint.clangformat", "clangformat.lock")

def config_request(self, dirs: Iterable[str]) -> ConfigFilesRequest:
"""clang-format will use the closest configuration file to the file currently being
"""Clang-format will use the closest configuration file to the file currently being
formatted, so add all of them."""
config_files = (
".clang-format",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

"""Generate Python sources from Protocol Buffers (Protobufs).

See https://www.pantsbuild.org/docs/protobuf.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

"""A formatter for C/C++ (and several other languages).
See https://clang.llvm.org/docs/ClangFormat.html for details.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

"""A formatter for JS/TS (and several other languages).
See https://prettier.io/ for details.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

"""A python "framework" for apps to dynamically load plugins.
See https://github.com/openstack/stevedore for details.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

"""Autoformatter to automatically add trailing commas to calls and literals.

See https://github.com/asottile/add-trailing-comma for details.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

"""Linter & formatter for Python.

See https://www.pantsbuild.org/docs/python-linters-and-formatters and https://docs.astral.sh/ruff/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

"""Static type checker for Python, running on NodeJS.

See https://github.com/Microsoft/pyright for details.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

"""Lightweight static analysis for many languages. Find bug variants with patterns that look like
source code.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

"""A configurable linter for YAML files.

See https://yamllint.readthedocs.io/ for details.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

"""Create Google Cloud Functions from Python code.

See https://www.pantsbuild.org/docs/google-cloud-function-python.
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/backend/project_info/count_loc_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def test_passthrough_args(rule_runner: RuleRunner) -> None:


def test_files_without_owners(rule_runner: RuleRunner) -> None:
"""cloc works on any readable file in the build root, regardless of whether it's declared in a
"""Cloc works on any readable file in the build root, regardless of whether it's declared in a
BUILD file."""
rule_runner.write_files(
{
Expand Down
1 change: 0 additions & 1 deletion src/python/pants/backend/project_info/register.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

"""Information on your project, such as listing the targets in your project."""

from pants.backend.project_info import (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def two_groups_hyphens_two_replacements_with_suffix(
second_group_replacement: str = "",
custom_suffix: str = "",
) -> str:
"""take two groups, and by default, the first will have '-' replaced with '.', the second will
"""Take two groups, and by default, the first will have '-' replaced with '.', the second will
have '-' replaced with '' e.g. google-cloud-foo-bar -> group1(google.cloud.)group2(foobar)

>>> two_groups_hyphens_two_replacements_with_suffix(re.match(r"^(google-cloud-)([^.]+)", "google-cloud-foo-bar"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ class FirstPartyPythonModuleMapping:
resolves_to_modules_to_providers: FrozenDict[
ResolveName, FrozenDict[str, Tuple[ModuleProvider, ...]]
]

"""A merged mapping of each resolve name to the first-party module names contained and their
owning addresses.

Expand Down
1 change: 0 additions & 1 deletion src/python/pants/backend/python/lint/autoflake/register.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

"""Autoformatter for removing unused Python imports.
See https://github.com/myint/autoflake for details.
Expand Down
1 change: 0 additions & 1 deletion src/python/pants/backend/python/lint/bandit/register.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

"""Security linter for Python.

See https://www.pantsbuild.org/docs/python-linters-and-formatters and
Expand Down
1 change: 0 additions & 1 deletion src/python/pants/backend/python/lint/black/register.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

"""Autoformatter for Python.

See https://www.pantsbuild.org/docs/python-linters-and-formatters and
Expand Down
Loading
Loading