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

lxddoc: Within a config group, alphabetically sort the config options #12114

Merged
merged 2 commits into from
Aug 3, 2023

Conversation

gabrielmougard
Copy link
Contributor

@gabrielmougard gabrielmougard commented Aug 3, 2023

Alphabetically sort the config options within a config group

Copy link
Contributor

@monstermunchkin monstermunchkin left a comment

Choose a reason for hiding this comment

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

Could this be put into a separate function? That way, we could add unit tests to ensure the function does what it's supposed to do.

lxd/config/generate/lxddoc.go Outdated Show resolved Hide resolved
Comment on lines 209 to 210
c := configEntry.(map[string]any)
for k := range c {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
c := configEntry.(map[string]any)
for k := range c {
for k := range configEntry.(map[string]any) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, c is further used within the loop

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh right, I overlooked that.

Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
@gabrielmougard
Copy link
Contributor Author

@monstermunchkin added a unit test for the sorting function

@gabrielmougard
Copy link
Contributor Author

thanks

Copy link
Contributor

@ru-fu ru-fu left a comment

Choose a reason for hiding this comment

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

Works as expected, thanks! :)

This is ready for merging @tomponline

@tomponline tomponline merged commit b7f2eb3 into canonical:main Aug 3, 2023
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants