Wednesday, September 16, 2020

Wrestling with &errorformat and ISO-8601 timestamps

I like to run Python unit tests using asyncrun.vim[*] and look at the
results in the quickfix window. One thing that annoys me is that when
the output contains assertion failures involving ISO-8601 timestamps
like this one:

E AssertionError: assert 'GitLab proje...tion: 42s\n' == 'GitLab proje...ob created:\n'
E GitLab project: owner/project
E - Job created: tbd
E + Job created: 2020-09-16T06:16:49.180Z
E + Job started: 2020-09-16T06:16:51.066Z
E + Job finished: not yet
E + Job duration: 42s

tests.py:346: AssertionError

Vim thinks there's an error on line 16 of a file named
"E + Job created: 2020-09-16T06"

How can I tell Vim that, as a Linux user, I don't believe in file names
with spaces in them? Or, as a compromise with Windows users, that file
names with multiple sequential spaces are _extremely_ unlikely?

My &errorformat is set as follows in my .vimrc:

set errorformat&
set errorformat-=%f(%l):%m
set errorformat+=E\ %#File\ \"%f\"\\,\ line\ %l%.%#
set errorformat+=File\ \"%f\"\\,\ line\ %l\\,%#%m

The help says %f pays attention to &isfname, which I haven't tweaked
much:

set isfname-=\=

and it does not include a space AFAICT.

Please help, vim_use@, you're my only hope!


[*] I have this set of plugins[+] that figure out the name of the unit
test that my cursor is inside, so I can press Ctrl+F9 and run that
single test in isolation, in the background, with my statusline
changing color to indicate test running/success/failed, with
quickfix opening automatically in case of failure. Ctrl+Shift+F9
reruns the last test so I can quickly fix the code and see if that
helped without navigating back to the test. Life would be utter
bliss except for this one small annoyance.

[+] https://github.com/mgedmin/dotvim/blob/master/vimrc

Marius Gedminas
--
I went cold turkey on games early on in college in an attempt to focus; in
retrospect, putting Linux on my primary computer to help enforce that was
likely a valuable career decision.
-- Evan Martin

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20200916071242.ucljn2uuelgh6owu%40blynas.

No comments: