Skip to content

Commit a9faa2e

Browse files
committed
fix linting
1 parent 4e61f84 commit a9faa2e

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/python/pants/backend/docker/goals/package_image.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,10 +387,11 @@ def get_build_options(
387387
DockerBuildOptionFlagFieldMixin,
388388
),
389389
):
390-
391-
flag = getattr(field_type, "docker_build_option", None) # get the flag name if it exists such as --pull or --network, etc.
390+
flag = getattr(
391+
field_type, "docker_build_option", None
392+
) # get the flag name if it exists such as --pull or --network, etc.
392393
if flag and flag in overridden_flags:
393-
continue # skip this field since its flag is already covered by extra_options
394+
continue # skip this field since its flag is already covered by extra_options
394395

395396
source = InterpolationContext.TextSource(
396397
address=target.address, target_alias=target.alias, field_alias=field_type.alias

src/python/pants/backend/docker/goals/package_image_test.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2974,6 +2974,7 @@ def test_field_set_pushes_on_package(output: dict | None, expected: bool) -> Non
29742974
)
29752975
assert field_set.pushes_on_package() is expected
29762976

2977+
29772978
def test_global_build_extra_options(rule_runner: RuleRunner) -> None:
29782979
"""Global build_extra_options from [docker] should be passed to the docker build command."""
29792980
rule_runner.set_options(
@@ -3066,6 +3067,7 @@ def check_build_process(result: DockerImageBuildProcess):
30663067
build_process_assertions=check_build_process,
30673068
)
30683069

3070+
30693071
def test_global_extra_options_overridden_by_target_extra_options(
30703072
rule_runner: RuleRunner,
30713073
) -> None:
@@ -3127,14 +3129,15 @@ def test_global_build_no_cache_options_exits(
31273129

31283130
def check_build_process(result: DockerImageBuildProcess):
31293131
argv = result.process.argv
3130-
assert "--no-cache" in argv
3132+
assert "--no-cache" in argv
31313133

31323134
assert_build_process(
31333135
rule_runner,
31343136
Address("docker/test", target_name="img1"),
31353137
build_process_assertions=check_build_process,
31363138
)
31373139

3140+
31383141
def test_global_build_no_cache_options_overridden_by_target_extra_options(
31393142
rule_runner: RuleRunner,
31403143
) -> None:
@@ -3153,10 +3156,10 @@ def test_global_build_no_cache_options_overridden_by_target_extra_options(
31533156

31543157
def check_build_process(result: DockerImageBuildProcess):
31553158
argv = result.process.argv
3156-
assert "--no-cache" in argv
3159+
assert "--no-cache" in argv
31573160

31583161
assert_build_process(
31593162
rule_runner,
31603163
Address("docker/test", target_name="img1"),
31613164
build_process_assertions=check_build_process,
3162-
)
3165+
)

0 commit comments

Comments
 (0)