Skip to content

chore(ruff): resolve lint exceptions for virtual_machine provider/pro…#7344

Merged
robertomonteromiguel merged 1 commit into
mainfrom
robertomonteromiguel/aws_format_code_v1
Jul 20, 2026
Merged

chore(ruff): resolve lint exceptions for virtual_machine provider/pro…#7344
robertomonteromiguel merged 1 commit into
mainfrom
robertomonteromiguel/aws_format_code_v1

Conversation

@robertomonteromiguel

Copy link
Copy Markdown
Collaborator

Summary

Cleans up the per-file ruff ignores for utils/virtual_machine/virtual_machine_provider.py and utils/virtual_machine/virtual_machine_provisioner.py by fixing the underlying violations instead of suppressing them. Only safe, behavior-preserving changes were made; risky ones were intentionally left marked with an explanatory comment.

Changes

utils/virtual_machine/virtual_machine_provider.py — removed 10 ignored rules:

  • RET505: replaced elif/else-after-return with plain if guards in get_provider.
  • ANN201: added return type annotations (-> None and -> pulumi_command.remote.Command).
  • E731: converted the output_callback lambda into a nested def.
  • E501: wrapped an over-long comment and split a long shell-command string via implicit concatenation (value unchanged).
  • PTH112 / PTH119: replaced os.path.isdir(...) / os.path.basename(...) with pathlib.Path equivalents.
  • A002: renamed the shadowing id parameter to copy_id in the base copy_file stub.
  • ARG002: prefixed the unused vm/server args of the base create_cache with _.
  • F541: dropped the useless f prefix.
  • FBT002: stale entry (no actual violation), also removed.

Intentionally kept (risky / would break behavior)

  • PLC0415 (virtual_machine_provider.py): the imports inside get_provider are deliberate lazy imports that avoid circular dependencies between provider modules. Kept with an explanatory comment.
  • S506 (virtual_machine_provisioner.py): yaml.load(..., Loader=yaml.FullLoader) can't become yaml.safe_load because YamlIncludeConstructor is registered against FullLoader to support !include in the provision YAMLs.

Workflow

  1. ⚠️ Create your PR as draft ⚠️
  2. Work on you PR until the CI passes
  3. Mark it as ready for review
    • Test logic is modified? -> Get a review from RFC owner.
    • Framework is modified, or non obvious usage of it -> get a review from R&P team

🚀 Once your PR is reviewed and the CI green, you can merge it!

🛟 #apm-shared-testing 🛟

Reviewer checklist

  • Anything but tests/ or manifests/ is modified ? I have the approval from R&P team
  • A docker base image is modified?
    • the relevant build-XXX-image label is present
  • A scenario is added, removed or renamed?

@github-actions

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

pyproject.toml                                                          @DataDog/system-tests-core
utils/virtual_machine/virtual_machine_provider.py                       @DataDog/system-tests-core

@robertomonteromiguel
robertomonteromiguel marked this pull request as ready for review July 20, 2026 15:41
@robertomonteromiguel
robertomonteromiguel requested a review from a team as a code owner July 20, 2026 15:41
@robertomonteromiguel
robertomonteromiguel merged commit dc8f08c into main Jul 20, 2026
718 of 719 checks passed
@robertomonteromiguel
robertomonteromiguel deleted the robertomonteromiguel/aws_format_code_v1 branch July 20, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant