Use bat for Syntax-Highlighted PKGBUILD Review
Is your feature request related to a problem? Please describe.
I'm always frustrated when reviewing PKGBUILD scripts within yay, as the default method lacks syntax highlighting and proper formatting. This makes it harder to quickly understand and analyze the script's contents.
Describe the solution you'd like
It would be a great enhancement if yay could leverage the bat tool to display PKGBUILD scripts. bat provides syntax highlighting and a more visually appealing output, which would improve readability and make it easier to review scripts for potential issues.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
go away stale bot
yay uses the git diff command for diffs. Integrating bat seems a bit harder as output would have to be piped (twice, probably to less after). I think this could probably be done by creating a script that you set as your pager tool.
For something out of the box, I'm a big fan of https://github.com/dandavison/delta which you can then set as ~/.gitconfig:
[core]
pager = delta
[interactive]
diffFilter = delta --color-only
[delta]
navigate = true # use n and N to move between diff sections
dark = true # or light = true, or omit for auto-detection
[merge]
conflictstyle = zdiff3
Thanks for the answer, I will check this out. The idea of using bat came up, because paru provides this feature
Here's how it's done in paru if this helps: https://github.com/Morganamilo/paru/blob/55efaabda3567908c3875cea0dcd3f47847896b3/src/download.rs#L590
Now this would be amazing, following to see how it goes. It's possible to generate a separate pager-stream output for yay, and that would allow the use of pager in EVERYTHING that yay does, if we rewrite how the existing stdout paging works by having it reference a single output command which we then wrap all the streams in, but I'm not sure how large a refactor that would be, given that would be a lot, right? And given how horrendous I am with Golang, as a C/C++ dev, I'm utterly lost on how to start something like this on yay hahah.