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

Sort packages in Directory.packages.props #1471

Open
qrzychu opened this issue Feb 3, 2025 · 1 comment
Open

Sort packages in Directory.packages.props #1471

qrzychu opened this issue Feb 3, 2025 · 1 comment

Comments

@qrzychu
Copy link

qrzychu commented Feb 3, 2025

I looked around, but haven't found anything related.

Would it be possible to add a cleanup step for sorting packages in Directory.packages.props alphabethicaly?

It's a pain in the ass doing this by hand, especially if someone (yeah, that happens....) puts the version before the package name.

It would be awesome to have CSharpier just reprint the whole thing in order, sort the attributes (like name, then version) etc.

I would even be willing to implement this if you agree that this is a good idea!

@belav
Copy link
Owner

belav commented Feb 4, 2025

It is a bit outside of the scope of csharpier.... but csharpier does sort usings. And the soon to be released 1.0.0 version does format xml. I'm thinking it would fit for csharpier to sort packages.props files. And possibly also some other known parts of csprojs - maybe just PackageReference elements. I think the order of PropertyGroup children can matter if they have conditions on them.

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

No branches or pull requests

2 participants