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

CFE-3785: Changed cfbs pretty command to always wrap non-empty top level collections #191

Merged
merged 1 commit into from
May 3, 2024

Conversation

mineralsfree
Copy link
Contributor

Ticket: CFE-3785
Changelog: None
Signed-off-by: Mikita Pilinka mikita.pilinka@northern.tech

Copy link
Contributor

@larsewi larsewi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work 🚀

@olehermanse olehermanse changed the title CFE-3785: pretty should always wrap the top level collections CFE-3785: Changed cfbs pretty command to always wrap the top level collection May 2, 2024
cfbs/pretty.py Outdated
Comment on lines 238 to 239
if not lst and indent == 0:
return "[\n]"
elif not lst:
return "[]"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mineralsfree @larsewi How about keeping it on one line if it's completely empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree 👍

cfbs/pretty.py Outdated
Comment on lines 263 to 262
if not dct and indent == 0:
return "{\n}"
elif not dct:
return "{}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@olehermanse olehermanse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, left one suggestion / question.

A couple of notes:
I edited the PR title to be past tense and perhaps a bit easier to understand. In this repo (same in cf-remote) we release in GitHub, and PR titles get automatically added to changelogs (Changelog: None has no effect). Also, this change is user facing, so I think it makes sense to include in changelogs.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Ticket: CFE-3785
Changelog: None
Signed-off-by: Mikita Pilinka <mikita.pilinka@northern.tech>
@mineralsfree mineralsfree requested a review from olehermanse May 3, 2024 07:22
@olehermanse olehermanse changed the title CFE-3785: Changed cfbs pretty command to always wrap the top level collection CFE-3785: Changed cfbs pretty command to always wrap non-empty top level collections May 3, 2024
@olehermanse olehermanse merged commit 5282b8a into cfengine:master May 3, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants