-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix the ecosystem check #10155
Fix the ecosystem check #10155
Conversation
We need to bump the number of files we expect to have formatting violations following #10093
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
I001 | 9 | 9 | 0 | 0 | 0 |
F401 | 8 | 8 | 0 | 0 | 0 |
PLR2004 | 4 | 4 | 0 | 0 | 0 |
E741 | 3 | 3 | 0 | 0 | 0 |
UP032 | 2 | 2 | 0 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+45 -0 violations, +0 -0 fixes in 2 projects; 41 projects unchanged)
aws/aws-sam-cli (+41 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ samcli/commands/build/build_context.py:53:1: PLR0904 Too many public methods (26 > 20) + samcli/commands/build/build_context.py:54:9: PLR0917 Too many positional arguments (26/5) + samcli/commands/build/build_context.py:581:46: E741 Ambiguous variable name: `l` + samcli/commands/build/build_context.py:5:1: I001 [*] Import block is un-sorted or un-formatted + samcli/commands/build/build_context.py:610:21: E741 Ambiguous variable name: `l` + samcli/commands/build/build_context.py:642:46: E741 Ambiguous variable name: `l` + samcli/commands/build/command.py:139:5: PLR0917 Too many positional arguments (25/5) + samcli/commands/build/command.py:200:5: PLR0917 Too many positional arguments (22/5) + samcli/commands/build/command.py:228:5: PLC0415 `import` should be at the top-level of a file + samcli/commands/build/command.py:25:5: F401 [*] `samcli.commands._utils.options.terraform_plan_file_option` imported but unused + samcli/commands/build/command.py:5:1: I001 [*] Import block is un-sorted or un-formatted + samcli/commands/build/core/options.py:5:1: I001 [*] Import block is un-sorted or un-formatted + samcli/lib/build/app_builder.py:1003:28: PLR2004 Magic value used in comparison, consider replacing `-32601` with a constant variable + samcli/lib/build/app_builder.py:458:9: PLR0917 Too many positional arguments (10/5) + samcli/lib/build/app_builder.py:45:44: F401 [*] `samcli.local.docker.exceptions.ContainerNotStartableException` imported but unused + samcli/lib/build/app_builder.py:593:9: PLR0917 Too many positional arguments (11/5) + samcli/lib/build/app_builder.py:5:1: I001 [*] Import block is un-sorted or un-formatted + samcli/lib/build/app_builder.py:732:9: PLR0917 Too many positional arguments (8/5) ... 7 additional changes omitted for rule PLR0917 + samcli/lib/build/app_builder.py:991:16: PLR2004 Magic value used in comparison, consider replacing `400` with a constant variable + samcli/lib/build/app_builder.py:991:34: PLR2004 Magic value used in comparison, consider replacing `500` with a constant variable + samcli/lib/build/app_builder.py:995:28: PLR2004 Magic value used in comparison, consider replacing `505` with a constant variable + samcli/lib/build/build_graph.py:379:13: PLW1514 `open` in text mode without explicit `encoding` argument + samcli/lib/build/build_graph.py:471:13: PLW1514 `open` in text mode without explicit `encoding` argument + samcli/lib/build/build_graph.py:515:7: PLW1641 Object does not implement `__hash__` method + samcli/lib/build/build_graph.py:579:7: PLW1641 Object does not implement `__hash__` method + samcli/lib/build/build_graph.py:5:1: I001 [*] Import block is un-sorted or un-formatted + samcli/lib/build/build_strategy.py:30:51: F401 [*] `samcli.lib.utils.architecture.ARM64` imported but unused + samcli/lib/build/build_strategy.py:5:1: I001 [*] Import block is un-sorted or un-formatted ... 4 additional changes omitted for rule I001 + samcli/lib/build/bundler.py:10:50: F401 [*] `samcli.commands.local.lib.exceptions.InvalidHandlerPathError` imported but unused + samcli/lib/build/bundler.py:7:27: F401 [*] `pathlib.PosixPath` imported but unused + samcli/lib/build/utils.py:17:28: PLR6201 Use a `set` literal when testing for membership + samcli/lib/build/workflow_config.py:7:42: F401 [*] `typing.Tuple` imported but unused ... 1 additional changes omitted for rule F401
pypa/pip (+4 -0 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview
+ src/pip/_internal/operations/build/build_tracker.py:6:47: F401 [*] `typing.Set` imported but unused + src/pip/_internal/operations/build/build_tracker.py:8:39: F401 [*] `pip._internal.models.link.Link` imported but unused + src/pip/_internal/operations/build/wheel_legacy.py:43:15: UP032 [*] Use f-string instead of `format` call + src/pip/_internal/operations/build/wheel_legacy.py:49:15: UP032 [*] Use f-string instead of `format` call
Changes by rule (11 rules affected)
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
PLR0917 | 12 | 12 | 0 | 0 | 0 |
I001 | 9 | 9 | 0 | 0 | 0 |
F401 | 8 | 8 | 0 | 0 | 0 |
PLR2004 | 4 | 4 | 0 | 0 | 0 |
E741 | 3 | 3 | 0 | 0 | 0 |
PLW1514 | 2 | 2 | 0 | 0 | 0 |
PLW1641 | 2 | 2 | 0 | 0 | 0 |
UP032 | 2 | 2 | 0 | 0 | 0 |
PLR0904 | 1 | 1 | 0 | 0 | 0 |
PLC0415 | 1 | 1 | 0 | 0 | 0 |
PLR6201 | 1 | 1 | 0 | 0 | 0 |
Formatter (stable)
ℹ️ ecosystem check detected format changes. (+3 -1 lines in 1 file in 1 projects; 1 project error; 41 projects unchanged)
aws/aws-sam-cli (+3 -1 lines across 1 file)
samcli/lib/build/app_builder.py~L644
# pylint: disable=fixme
# FIXME: _build_lambda_image assumes metadata is not None, we need to throw an exception here
return self._build_lambda_image(
- function_name=function_name, metadata=metadata, architecture=architecture # type: ignore
+ function_name=function_name,
+ metadata=metadata,
+ architecture=architecture, # type: ignore
)
if packagetype == ZIP:
if runtime in self._deprecated_runtimes:
openai/openai-cookbook (error)
warning: Detected debug build without --no-cache.
error: Failed to read examples/How_to_handle_rate_limits.ipynb: Expected a Jupyter Notebook, which must be internally stored as JSON, but this file isn't valid JSON: trailing comma at line 47 column 4
Formatter (preview)
ℹ️ ecosystem check detected format changes. (+48 -64 lines in 7 files in 2 projects; 1 project error; 40 projects unchanged)
aws/aws-sam-cli (+45 -58 lines across 4 files)
ruff format --preview
samcli/commands/build/build_context.py~L597
"""
result = ResourcesToBuildCollector()
excludes: Tuple[str, ...] = self._exclude if self._exclude is not None else ()
- result.add_functions(
- [
- f
- for f in self.function_provider.get_all()
- if (f.name not in excludes) and f.function_build_info.is_buildable()
- ]
- )
- result.add_layers(
- [
- l
- for l in self.layer_provider.get_all()
- if (l.name not in excludes) and BuildContext.is_layer_buildable(l)
- ]
- )
+ result.add_functions([
+ f
+ for f in self.function_provider.get_all()
+ if (f.name not in excludes) and f.function_build_info.is_buildable()
+ ])
+ result.add_layers([
+ l for l in self.layer_provider.get_all() if (l.name not in excludes) and BuildContext.is_layer_buildable(l)
+ ])
return result
@property
samcli/lib/build/app_builder.py~L644
# pylint: disable=fixme
# FIXME: _build_lambda_image assumes metadata is not None, we need to throw an exception here
return self._build_lambda_image(
- function_name=function_name, metadata=metadata, architecture=architecture # type: ignore
+ function_name=function_name,
+ metadata=metadata,
+ architecture=architecture, # type: ignore
)
if packagetype == ZIP:
if runtime in self._deprecated_runtimes:
samcli/lib/build/bundler.py~L130
if not isinstance(existing_options, str):
invalid_node_option = True
else:
- template_resource["Properties"]["Environment"]["Variables"]["NODE_OPTIONS"] = " ".join(
- [existing_options, "--enable-source-maps"]
- )
+ template_resource["Properties"]["Environment"]["Variables"]["NODE_OPTIONS"] = " ".join([
+ existing_options,
+ "--enable-source-maps",
+ ])
using_source_maps = True
samcli/lib/build/workflow_config.py~L166
"go1.x": BasicWorkflowSelector(GO_MOD_CONFIG),
# When Maven builder exists, add to this list so we can automatically choose a builder based on the supported
# manifest
- "java8": ManifestWorkflowSelector(
- [
- # Gradle builder needs custom executable paths to find `gradlew` binary
- JAVA_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
- JAVA_KOTLIN_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
- JAVA_MAVEN_CONFIG,
- ]
- ),
- "java11": ManifestWorkflowSelector(
- [
- # Gradle builder needs custom executable paths to find `gradlew` binary
- JAVA_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
- JAVA_KOTLIN_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
- JAVA_MAVEN_CONFIG,
- ]
- ),
- "java8.al2": ManifestWorkflowSelector(
- [
- # Gradle builder needs custom executable paths to find `gradlew` binary
- JAVA_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
- JAVA_KOTLIN_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
- JAVA_MAVEN_CONFIG,
- ]
- ),
- "java17": ManifestWorkflowSelector(
- [
- # Gradle builder needs custom executable paths to find `gradlew` binary
- JAVA_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
- JAVA_KOTLIN_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
- JAVA_MAVEN_CONFIG,
- ]
- ),
- "java21": ManifestWorkflowSelector(
- [
- # Gradle builder needs custom executable paths to find `gradlew` binary
- JAVA_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
- JAVA_KOTLIN_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
- JAVA_MAVEN_CONFIG,
- ]
- ),
+ "java8": ManifestWorkflowSelector([
+ # Gradle builder needs custom executable paths to find `gradlew` binary
+ JAVA_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
+ JAVA_KOTLIN_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
+ JAVA_MAVEN_CONFIG,
+ ]),
+ "java11": ManifestWorkflowSelector([
+ # Gradle builder needs custom executable paths to find `gradlew` binary
+ JAVA_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
+ JAVA_KOTLIN_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
+ JAVA_MAVEN_CONFIG,
+ ]),
+ "java8.al2": ManifestWorkflowSelector([
+ # Gradle builder needs custom executable paths to find `gradlew` binary
+ JAVA_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
+ JAVA_KOTLIN_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
+ JAVA_MAVEN_CONFIG,
+ ]),
+ "java17": ManifestWorkflowSelector([
+ # Gradle builder needs custom executable paths to find `gradlew` binary
+ JAVA_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
+ JAVA_KOTLIN_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
+ JAVA_MAVEN_CONFIG,
+ ]),
+ "java21": ManifestWorkflowSelector([
+ # Gradle builder needs custom executable paths to find `gradlew` binary
+ JAVA_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
+ JAVA_KOTLIN_GRADLE_CONFIG._replace(executable_search_paths=[code_dir, project_dir]),
+ JAVA_MAVEN_CONFIG,
+ ]),
"provided": BasicWorkflowSelector(PROVIDED_MAKE_CONFIG),
"provided.al2": BasicWorkflowSelector(PROVIDED_MAKE_CONFIG),
"provided.al2023": BasicWorkflowSelector(PROVIDED_MAKE_CONFIG),
pypa/pip (+3 -6 lines across 3 files)
ruff format --preview
src/pip/_internal/operations/build/metadata.py~L1
-"""Metadata generation logic for source distributions.
-"""
+"""Metadata generation logic for source distributions."""
import os
src/pip/_internal/operations/build/metadata_editable.py~L1
-"""Metadata generation logic for source distributions.
-"""
+"""Metadata generation logic for source distributions."""
import os
src/pip/_internal/operations/build/metadata_legacy.py~L1
-"""Metadata generation logic for legacy source distributions.
-"""
+"""Metadata generation logic for legacy source distributions."""
import logging
import os
openai/openai-cookbook (error)
ruff format --preview
warning: Detected debug build without --no-cache.
error: Failed to read examples/How_to_handle_rate_limits.ipynb: Expected a Jupyter Notebook, which must be internally stored as JSON, but this file isn't valid JSON: trailing comma at line 47 column 4
We need to bump the number of files we expect to have formatting violations following #10093