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

Adds the ability to specify sorting options for groups. #807

Merged
merged 8 commits into from
Feb 22, 2021
Merged

Adds the ability to specify sorting options for groups. #807

merged 8 commits into from
Feb 22, 2021

Conversation

connor-ricks
Copy link
Contributor

@connor-ricks connor-ricks commented Jan 30, 2021

The sort command doesn't allow the user to specify how they want their project sorted. Instead, groups and files are sorted alphabetically and interleaved with each other.

Xcodeproj already supports the ability to sort with groups above or below files, but the functionality is not exposed to the cli command.

This PR simply exposes that functionality with a new option.

@dnkoutso
Copy link
Contributor

Thanks! can you add a changelog entry and some tests?

@connor-ricks
Copy link
Contributor Author

Thanks! can you add a changelog entry and some tests?

I was looking around the repo at some example tests, and it looks like there is decent coverage for the sort functionality already. Is there an example I can look at for testing the actual command options and such? My only changes are command file.

@dnkoutso
Copy link
Contributor

dnkoutso commented Jan 30, 2021

Ah looks like sort.rb does not have any specs...there should be sort_spec.rb....

@connor-ricks
Copy link
Contributor Author

Ah looks like sort.rb does not have any specs...there should be sort_spec.rb....

What would the objectives of these tests be? (Sorry, I'm new to ruby) I can see that the group_spec.rb already tests both the above and below functionality.

I tried looking for examples of specs for any of the commands under lib/xcodeproj/commands but I didn't see a spec for any of the CLI commands.

@dnkoutso
Copy link
Contributor

The new tests should test the fact that anyone can pass in the new parameters you added in sort.rb and make sure the correct parameters are delegated further down.

@connor-ricks
Copy link
Contributor Author

Might take a while for me to investigate how to write these tests. I have 0 Ruby experience, so if anyone else wants to contribute, that would be amazing. Otherwise, I'll get around to it in my free time.

@connor-ricks
Copy link
Contributor Author

@dnkoutso Managed to get a friend with some Ruby knowledge to add some tests. 🥳

@dnkoutso dnkoutso merged commit 83bd241 into CocoaPods:master Feb 22, 2021
@connor-ricks connor-ricks deleted the improve-sort-functionality branch February 22, 2021 19:13
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