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

CFn: fix reserved python keyword usage in scaffolding plugin #9492

Merged
merged 3 commits into from Oct 27, 2023

Conversation

simonrw
Copy link
Contributor

@simonrw simonrw commented Oct 27, 2023

Motivation

There was an issue when generating the Lambda resources. It would generate an import path containing the word "lambda", which is a reserved keyword in Python. The actual failure was when trying to run black over the codebase.

Changes

  • Use python compatible name for module
  • Sort resource provider list to reduce the number of merge conflicts
  • Add option to not run black, since running black is a common source of errors. It checks the code is valid Python, but sometimes you just want to scaffold a resource and fix the issues yourself. Black will be run on the resulting file anyway.

Testing

python -m localstack.services.cloudformation.scaffold generate -r "AWS::Lambda::Version" should work

This should reduce the number of merge conflicts in the future
I put the property in there, I must have just missed a point of its
usage 🤦
@simonrw simonrw added aws:cloudformation AWS CloudFormation semver: patch Non-breaking changes which can be included in patch releases labels Oct 27, 2023
@simonrw simonrw self-assigned this Oct 27, 2023
@coveralls
Copy link

Coverage Status

coverage: 82.442% (+0.01%) from 82.431% when pulling 709134a on cfn/fix/scaffolding-reserved-keyword into 64ca50f on master.

@github-actions
Copy link

LocalStack Community integration with Pro

       2 files         2 suites   1h 8m 24s ⏱️
2 288 tests 1 708 ✔️ 580 💤 0
2 289 runs  1 708 ✔️ 581 💤 0

Results for commit 709134a.

@simonrw simonrw merged commit a272770 into master Oct 27, 2023
32 checks passed
@simonrw simonrw deleted the cfn/fix/scaffolding-reserved-keyword branch October 27, 2023 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws:cloudformation AWS CloudFormation semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants