-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Format policy_templates.json #2760
Format policy_templates.json #2760
Conversation
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 for bringing this up. Can you also add this file to CI check so its format can be enforced? Thanks:
related code:
serverless-application-model/Makefile
Line 32 in d74a89c
bin/json-format.py --check tests integration |
- added policy_templates.json to Makefile json-format.py - formatted it using json-format.py
thank you for the review! added it to Makefile black json-format.py and also formatted it using it Looks like it was not previously added to it as it formats it with regards to layout as well (e.g. "Version" at the end of the file instead of at the beginning) which not be the behavior we want. I can revert this change if you want. |
Consistent automated formatting is better than a fancy but manual one. I'd say it stays. |
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.
verified with
bin/json-format.py --write samtranslator/policy_templates_data/policy_templates.json
reformatted samtranslator/policy_templates_data/policy_templates.json
1 file(s) scanned.
1 file(s) reformatted.
All done! ✨ 🍰 ✨
(samtranslator37) ~/P/serverless-application-model ❯❯❯ cp samtranslator/policy_templates_data/policy_templates.json policy_templates.bak.json
(samtranslator37) ~/P/serverless-application-model ❯❯❯ git co -- .
(samtranslator37) ~/P/serverless-application-model ❯❯❯ g remote add mustafa-sadiq-icf [email protected]:mustafa-sadiq-icf/serverless-application-model.git
(samtranslator37) ~/P/serverless-application-model ❯❯❯ g fetch mustafa-sadiq-icf
remote: Enumerating objects: 21, done.
remote: Counting objects: 100% (21/21), done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 21 (delta 12), reused 18 (delta 9), pack-reused 0
Unpacking objects: 100% (21/21), 5.87 KiB | 176.00 KiB/s, done.
From github.com:mustafa-sadiq-icf/serverless-application-model
* [new branch] develop -> mustafa-sadiq-icf/develop
* [new branch] feat/sam-canary -> mustafa-sadiq-icf/feat/sam-canary
* ....
(samtranslator37) ~/P/serverless-application-model ❯❯❯ g co policy-template/formatting
branch 'policy-template/formatting' set up to track 'mustafa-sadiq-icf/policy-template/formatting' by rebasing.
Switched to a new branch 'policy-template/formatting'
(samtranslator37) ~/P/serverless-application-model ❯❯❯ diff samtranslator/policy_templates_data/policy_templates.json policy_templates.bak.json
(empty)
…on-model into policy-template/formatting
Co-authored-by: Mustafa Sadiq <[email protected]>
Issue #, if available
None I can find
Description of changes
The policy_templates.json has many formatting discrepancies. For example
CloudWatchDescribeAlarmHistoryPolicy has
"Parameters": {},
where as others have a empty block with white space
"Parameters": { },
RekognitionFacesManagementPolicy has not been formated with array object like other Statement objects
Description of how you validated changes
policy_templates.json is still valid JSON
Checklist
Examples?
Please reach out in the comments if you want to add an example. Examples will be
added to
sam init
through aws/aws-sam-cli-app-templates.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.