-
Notifications
You must be signed in to change notification settings - Fork 39
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
The compact output format should include a summary #1364
Comments
hi i would like to work on this issue, please guide me. |
thanks a lot for the code, ill go through it and suggest my approach to doing this. |
Thanks! And don't worry if you get stuck somewhere – let us know! As for this particular issue, I'd probably create a small example policy with a few violations in it to lint, like: p.rego package p
camelCase := "hello"
foo := true
bar := foo Then you can run your checked out Regal-code to lint it with the compact formatter:
If you change the format to
That's pretty much what we should have here too, and I'm sure you can borrow some code from the pretty formatter to accomplish that. The most difficult part is probably to make it look native to the compact format. Ideally it'd look something like this:
But obviously, with all the columns aligned, lol |
(lol we both commented at the same time, i read your comment, and yes i do need to formatt the print statement to align the table) I did some reading and heres what i think :
so it would look something like this:
What do you think? |
@anderseknert i did some testing with different ways we can print , but all felt non-native, even the example you have given feels like that, if it were up to me i would prefer the summary to be seperate from the table like so:
what do you think? here are some of the formats i tried : this ones super weird ik : this is the one i liked best : heres another images of the same with different file : |
I liked the example I gave (minus of course that it was written on my phone and looked like crap) mostly for that it would have a footer line similar to how the table has a header line. And it would make sense for the number of files linted to be reported below the name of the files. But I’m not sure the library allows a “footer” section like how it allows a header. Markdown certainly doesn’t. So yes, I agree. Of the alternatives you tried (and thanks for presenting them so clearly!) I too prefer the one you suggested. So if the footer option isn’t feasible, let’s go with that 👍 |
cool!, Let me try my best to implement the footer first, if it doesnt work out ill go with the option i presented. thanks a lot for guiding me . |
Thanks! And I appreciate it. Don’t spend too much time on it though, as what you have is infinitely better than what we currently do :) Looking forward to review your PR! |
@anderseknert i think we can append to the table itself!! heres 2 more options: or this? : |
Neat! And it’s almost there. Just slightly off with no “+” where the lines intersect in the first example, or the line looking different in the summary for the other example. But I was kinda expecting that making it look native would involve all sorts of hacks. If you want to spend your weekend getting that to look perfect, I’m not gonna stop you, lol. But really, the alternative you suggested is 100% good enough. |
Wow, you’re fast! The centered alignment is curious, but doesn’t bother me. Which one do you like the best yourself? Whichever you pick, we’ll go with it. |
All settled then! If your room mates have GitHub handles, mention them in the PR description and I’ll credit them in the next release changelog :) Thanks a lot for contributing to Regal! And welcome back anytime. Would love to work with you again. |
My roomates arent really cs grads, ones in mechatronics. thanks a lot for letting me work on this and guiding me through this, ill make a pr. (ps. this is my first pr to a big code repo im so happy) |
I have no formal CS education either, and I used to sell hi-fi equipment before I got my first developer job. I don’t judge :) Knowing I helped you to your first open source contribution is 👌 |
While the compact format should be compact, we can afford to include a one-liner summary similar to what the pretty formatter outputs.
The text was updated successfully, but these errors were encountered: