Tuesday, October 14, 2014

errorformat for unified diff?

I've put together a more or less working unified diff errorformat compiler plugin for git diff. It's not quite right, as I don't see a way to get the errorformat string to honor the hunk sizes, but it works well enough to be useful.

For context, my goal is to provide populate a quickfix list with all the git changes in a project for review.

It seems like unified diff parsing is potentially a more generally useful thing. Is there a better approach? Or a better approach to errorformat parsing? As I understand it grep works with the same backend.

FWIW here's the more or less working format. I'm sure it could (should) be cleaner (I'm sure I'm matching too much for instance)

CompilerSet errorformat=
\%-G+,
\%-P---\ a/%f,
\%-Gdiff%.%#,
\%-Gindex%.%#,
\%-G+++%.%#,
' \%A@@\ %.%#\ +%l%.%#\ %m,
\%C\ ,
\%C\-%m,
\%Z+%.%#,
\%-G\ ,
\%-G%.%#

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments: