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 output of discover #630

Closed
Bananeweizen opened this issue Sep 26, 2023 · 1 comment · Fixed by #632
Closed

Sort output of discover #630

Bananeweizen opened this issue Sep 26, 2023 · 1 comment · Fixed by #632
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Bananeweizen
Copy link
Contributor

Bananeweizen commented Sep 26, 2023

What problem are you trying to solve?

Make the output of the "discover" goal more easy to understand. Right now it's only partially sorted. Therefore composite recipes are often NOT near their contained recipes. Active recipes are completely shuffled, which makes it hard to find any active recipe in the list.

Describe the solution you'd like

  • Sort the output lexicographically. That means all the styles and recipes under the different categories.
  • Unify the indentation. Styles have way less (and better!) indentation than recipes.

See arrows in the screenshot showing the missing sort order.
grafik

@Bananeweizen Bananeweizen added the enhancement New feature or request label Sep 26, 2023
@timtebeek timtebeek moved this to Backlog in OpenRewrite Sep 26, 2023
@timtebeek timtebeek added the good first issue Good for newcomers label Sep 26, 2023
@timtebeek
Copy link
Contributor

Looks like the repeat here is off; it likely should just contain a single space.

private void writeRecipeDescriptor(RecipeDescriptor rd, boolean verbose, int currentRecursionLevel, int indentLevel) {
String indent = StringUtils.repeat(" ", indentLevel * 4);

Would you be open to try that out and create a pull request?

Bananeweizen added a commit to Bananeweizen/rewrite-maven-plugin that referenced this issue Sep 27, 2023
Bananeweizen added a commit to Bananeweizen/rewrite-maven-plugin that referenced this issue Sep 27, 2023
* sort just for output, not in any of the APIs returning the data
* sort case insensitive, which is generally better suited for humans
reading a list
timtebeek pushed a commit that referenced this issue Sep 27, 2023
* sort just for output, not in any of the APIs returning the data
* sort case insensitive, which is generally better suited for humans
reading a list
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenRewrite Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants