Skip to content

Commit a5427de

Browse files
committed
Revert "style: fix formatting issues across codebase"
This reverts commit ece6393.
1 parent ece6393 commit a5427de

11 files changed

Lines changed: 42 additions & 103 deletions

File tree

samcli/commands/init/interactive_init_flow.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,7 @@ def _generate_from_location(
193193
-----------------------
194194
Location: {location}
195195
Output Directory: {output_dir}
196-
""".format(
197-
location=location, output_dir=output_dir
198-
)
196+
""".format(location=location, output_dir=output_dir)
199197
click.echo(summary_msg)
200198
do_generate(
201199
location,

samcli/commands/pipeline/bootstrap/cli.py

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -338,17 +338,15 @@ def do_cli(
338338
if interactive:
339339
if standalone:
340340
click.echo(
341-
dedent(
342-
"""\
341+
dedent("""\
343342
344343
sam pipeline bootstrap generates the required AWS infrastructure resources to connect
345344
to your CI/CD system. This step must be run for each deployment stage in your pipeline,
346345
prior to running the sam pipeline init command.
347346
348347
We will ask for [1] stage definition, [2] account details, and
349348
[3] references to existing resources in order to bootstrap these pipeline resources.
350-
"""
351-
),
349+
"""),
352350
)
353351

354352
guided_context = GuidedContext(
@@ -421,26 +419,18 @@ def do_cli(
421419
config_dir=PIPELINE_CONFIG_DIR, filename=PIPELINE_CONFIG_FILENAME, cmd_names=_get_bootstrap_command_names()
422420
)
423421

424-
click.secho(
425-
dedent(
426-
f"""\
422+
click.secho(dedent(f"""\
427423
View the definition in {os.path.join(PIPELINE_CONFIG_DIR, PIPELINE_CONFIG_FILENAME)},
428424
run sam pipeline bootstrap to generate another set of resources, or proceed to
429425
sam pipeline init to create your pipeline configuration file.
430-
"""
431-
)
432-
)
426+
"""))
433427

434428
if not environment.pipeline_user.is_user_provided and not environment.use_oidc_provider:
435-
click.secho(
436-
dedent(
437-
f"""\
429+
click.secho(dedent(f"""\
438430
Before running {Colored().bold("sam pipeline init")}, we recommend first setting up AWS credentials
439431
in your CI/CD account. Read more about how to do so with your provider in
440432
{CONFIG_AWS_CRED_ON_CICD_URL}.
441-
"""
442-
)
443-
)
433+
"""))
444434

445435

446436
def _get_pipeline_oidc_provider(

samcli/commands/pipeline/bootstrap/guided_context.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,10 @@ def __init__(
8383
def _prompt_account_id(self) -> None:
8484
profiles = list_available_profiles()
8585
click.echo("The following AWS credential sources are available to use.")
86-
click.echo(
87-
dedent(
88-
f"""\
86+
click.echo(dedent(f"""\
8987
To know more about configuration AWS credentials, visit the link below:
9088
{CONFIG_AWS_CRED_DOC_URL}\
91-
"""
92-
)
93-
)
89+
"""))
9490
has_env_creds = os.getenv(EnvProvider.ACCESS_KEY) and os.getenv(EnvProvider.SECRET_KEY)
9591
click.echo(f"\t1 - Environment variables{' (not available)' if not has_env_creds else ''}")
9692
for i, profile in enumerate(profiles):

samcli/commands/pipeline/init/interactive_init_flow.py

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,15 @@ def do_interactive(self) -> None:
5858
runs its specific questionnaire then generates the pipeline config file
5959
based on the template and user's responses
6060
"""
61-
click.echo(
62-
dedent(
63-
"""\
61+
click.echo(dedent("""\
6462
6563
sam pipeline init generates a pipeline configuration file that your CI/CD system
6664
can use to deploy serverless applications using AWS SAM.
6765
We will guide you through the process to bootstrap resources for each stage,
6866
then walk through the details necessary for creating the pipeline config file.
6967
7068
Please ensure you are in the root folder of your SAM application before you begin.
71-
"""
72-
)
73-
)
69+
"""))
7470

7571
pipeline_template_source_question = Choice(
7672
key="pipeline-template-source",
@@ -176,9 +172,7 @@ def _prompt_run_bootstrap_within_pipeline_init(
176172
"you can still reference other bootstrapped resources.",
177173
default=True,
178174
):
179-
click.secho(
180-
dedent(
181-
"""\
175+
click.secho(dedent("""\
182176
183177
For each stage, we will ask for [1] stage definition, [2] account details, and [3]
184178
reference application build resources in order to bootstrap these pipeline
@@ -187,9 +181,7 @@ def _prompt_run_bootstrap_within_pipeline_init(
187181
We recommend using an individual AWS account profiles for each stage in your
188182
pipeline. You can set these profiles up using aws configure or ~/.aws/credentials. See
189183
[https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started-set-up-credentials.html].
190-
"""
191-
)
192-
) # pylint: disable=C0301
184+
""")) # pylint: disable=C0301
193185

194186
click.echo(Colored().bold(f"\nStage {len(stage_configuration_names) + 1} Setup\n"))
195187
do_bootstrap(
@@ -221,15 +213,11 @@ def _prompt_run_bootstrap_within_pipeline_init(
221213
)
222214
return True
223215
else:
224-
click.echo(
225-
dedent(
226-
"""\
216+
click.echo(dedent("""\
227217
To set up stage(s), please quit the process using Ctrl+C and use one of the following commands:
228218
sam pipeline init --bootstrap To be guided through the stage and config file creation process.
229219
sam pipeline bootstrap To specify details for an individual stage.
230-
"""
231-
)
232-
)
220+
"""))
233221
click.prompt(
234222
"To reference stage resources bootstrapped in a different account, press enter to proceed", default=""
235223
)

samcli/commands/publish/command.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232
for publishing. For more details on this metadata section, see
3333
{}
3434
\b
35-
""".format(
36-
SAM_PUBLISH_DOC
37-
)
35+
""".format(SAM_PUBLISH_DOC)
3836
SHORT_HELP = "Publish a packaged AWS SAM template to the AWS Serverless Application Repository."
3937
SERVERLESSREPO_CONSOLE_URL = "https://console.aws.amazon.com/serverlessrepo/home?region={}#/published-applications/{}"
4038
SEMANTIC_VERSION_HELP = "Optional. The value provided here overrides SemanticVersion in the template metadata."

samcli/commands/sync/command.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,8 @@ def do_cli(
316316

317317
# Note: ADL with use-container is not supported yet. Remove this logic once its supported.
318318
if use_container and dependency_layer:
319-
LOG.info(
320-
"Note: Automatic Dependency Layer is not yet supported with use-container. \
321-
sam sync will be run without Automatic Dependency Layer."
322-
)
319+
LOG.info("Note: Automatic Dependency Layer is not yet supported with use-container. \
320+
sam sync will be run without Automatic Dependency Layer.")
323321
dependency_layer = False
324322

325323
build_dir = DEFAULT_BUILD_DIR_WITH_AUTO_DEPENDENCY_LAYER if dependency_layer else DEFAULT_BUILD_DIR

samcli/lib/deploy/deployer.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,4 @@ def _gen_deploy_failed_with_rollback_disabled_msg(stack_name):
874874
=========================
875875
[*] Fix issues and try deploying again
876876
[*] Roll back stack to the last known stable state: aws cloudformation rollback-stack --stack-name {stack_name}
877-
""".format(
878-
stack_name=stack_name
879-
)
877+
""".format(stack_name=stack_name)

samcli/lib/observability/xray_traces/xray_event_mappers.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,8 @@ def map(self, event: XRayTraceEvent) -> XRayTraceEvent:
2626
formatted_segments = self.format_segments(event.segments)
2727
iso_formatted_timestamp = datetime.fromtimestamp(event.timestamp).isoformat()
2828
revision_info = f"[revision {event.revision}] " if event.revision else ""
29-
mapped_message = (
30-
f"\nXRay Event {revision_info}at ({iso_formatted_timestamp}) with \
31-
id ({event.id}) and duration ({event.duration:.3f}s)"
32-
f"{formatted_segments}"
33-
)
29+
mapped_message = f"\nXRay Event {revision_info}at ({iso_formatted_timestamp}) with \
30+
id ({event.id}) and duration ({event.duration:.3f}s)" f"{formatted_segments}"
3431
event.message = mapped_message
3532

3633
return event

tests/integration/local/invoke/test_integrations_cli.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -792,9 +792,7 @@ def _create_config_file(self, profile):
792792

793793
def _create_cred_file(self, profile):
794794
cred_file_content = "[{}]\naws_access_key_id = someaccesskeyid\naws_secret_access_key = shhhhhthisisasecret \
795-
\naws_session_token = sessiontoken".format(
796-
profile
797-
)
795+
\naws_session_token = sessiontoken".format(profile)
798796
custom_cred = os.path.join(self.config_dir, "customcred")
799797
with open(custom_cred, "w") as file:
800798
file.write(cred_file_content)

tests/integration/pipeline/test_init_command.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,7 @@ def test_with_pipelineconfig_has_all_stage_values(self, with_bootstrap):
152152
Path(PIPELINE_CONFIG_DIR).mkdir(parents=True, exist_ok=True)
153153
pipelineconfig_path = Path(PIPELINE_CONFIG_DIR, PIPELINE_CONFIG_FILENAME)
154154
with open(pipelineconfig_path, "w") as f:
155-
f.write(
156-
dedent(
157-
"""\
155+
f.write(dedent("""\
158156
version = 0.1
159157
[default]
160158
[default.pipeline_bootstrap]
@@ -178,9 +176,7 @@ def test_with_pipelineconfig_has_all_stage_values(self, with_bootstrap):
178176
artifacts_bucket = "prod-bucket"
179177
image_repository = "prod-ecr"
180178
region = "us-west-2"
181-
"""
182-
)
183-
)
179+
"""))
184180

185181
inputs = [
186182
"1", # quick start

0 commit comments

Comments
 (0)