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

feat: Retain json property order #75

Merged
merged 2 commits into from
Feb 26, 2021
Merged

feat: Retain json property order #75

merged 2 commits into from
Feb 26, 2021

Conversation

ghost
Copy link

@ghost ghost commented Feb 26, 2021

This PR retains the order of properties in a JSON file.

Currently, Dobby will alphabetize JSON properties, which means updating a package.json version will result in the package and version being placed below a long list of dependencies and dev-dependencies.

Workflows without a clean way to handle develop and release branches can run into issues when the standard/default order of package.json properties is rearranged in a single branch.

@ghost ghost requested review from Shadow53 and dbanty February 26, 2021 17:04
}

#[test]
fn test_retain_property_order() {
Copy link
Member

Choose a reason for hiding this comment

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

I assume my prefixing of functions with test_ is just a habit from Python and not required here. We may be able to omit that?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, I believe it's redundant. We already know it's a test, so the test_ prefix isn't adding any value.

@dbanty Do you want me to remove that in this PR, or would you rather we remove all of them in a separate PR?

Copy link
Member

Choose a reason for hiding this comment

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

I think we should address them as we encounter them, so swap it out here before we merge.

@dbanty dbanty merged commit 49d23da into main Feb 26, 2021
@dbanty dbanty deleted the retain-json-order branch February 26, 2021 19:58
@dbanty dbanty mentioned this pull request Feb 27, 2021
@dbanty dbanty added this to the 0.1.2 milestone Feb 27, 2021
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.

None yet

1 participant