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

Add alternative format for GitHub PR annotations #91

Closed
mroy-seedbox opened this issue Sep 26, 2024 · 9 comments · Fixed by #96
Closed

Add alternative format for GitHub PR annotations #91

mroy-seedbox opened this issue Sep 26, 2024 · 9 comments · Fixed by #96
Assignees
Labels
enhancement New feature or request

Comments

@mroy-seedbox
Copy link

mroy-seedbox commented Sep 26, 2024

First of all, thank you for the amazing Swiss army knife that is reLint! 🙏 💙

We use it to augment the linting that SQLFluff provides, since it only covers the basics (and not all of our SQL coding standards).

This feature request is basically to be able to easily post reLint results as annotation in GitHub PRs. Basically, something similar to what SQLFluff is doing: --format github-annotation-native.

Or do you think this is something that belongs outside of the reLint codebase? (kinda like container images)

If reLint doesn't provide alternative formats, then it would mean having to parse the reLint results in order to convert them into a different format. Not ideal, but doable. But a more machine-readable format would definitely help. Something like JSON might be ideal.

And a -n/--nocolor option could also be helpful, so that the output is more machine-readable. Although if raw JSON format is provided, then this option would be unnecessary. Nevermind! It looks like this already happens automatically when there is no tty! 🙌

@codingjoe codingjoe added the enhancement New feature or request label Sep 26, 2024
@codingjoe
Copy link
Owner

Hi @mroy-seedbox,

Thank you for your kind words, they mean a lot!

I think you are proposing a wonderful enhancement. I always wanted to do it, but never got around to implementing a compatible output.

Would you be interested in contributing this feature yourself? It's not too difficult, you can find GitHub's documentation here:
https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions

Cheers!
Joe

@mroy-seedbox
Copy link
Author

Absolutely! 🙌

I don't have the time for it right now, but I'll circle back to this as soon as I have more capacity!

@codingjoe
Copy link
Owner

@mroy-seedbox I found a minute to quickly address this. Thanks for bringing this to my attention. It's a much appreciated addition, and I honestly didn't know how easy this was to implement. Thanks!

@mroy-seedbox
Copy link
Author

Just made the change to have this in our CI/CD pipeline, and it's working well!

Thank you! 🙌

@mroy-seedbox
Copy link
Author

The next iteration on this would be to add file groups, like this.

It's a pretty simple change!

@codingjoe
Copy link
Owner

The next iteration on this would be to add file groups, like this.

It's a pretty simple change!

I thought about that, but do they do anything in the interface? It looks different in the run logs, but the line annotations on a PR stays the same, right?

@mroy-seedbox
Copy link
Author

mroy-seedbox commented Oct 18, 2024

Yeah, I believe the change is only aesthetic.

It groups the annotations per file in the logs, like this:
image

But it doesn't make any different anywhere else (AFAIK).

Otherwise, they are printed individually, like this:
image

@codingjoe
Copy link
Owner

It's done @mroy-seedbox. It's with grouping now.

@mroy-seedbox
Copy link
Author

Awesome, thank you so much!! 🙌 🙏 💙

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants