I have just discovered the utility bbresults thanks to Patrick at Bare 
Bones. As the manual page suggests, using it as processor of flake8 output 
is really useful. One little drawback of the current built-in parser is 
that the actual ID of an error or warning is consumed by the built-in 
flake8 regular expression. So why do I see this as a drawback? Depending on 
your coding style, preferences and/or the problem the code is trying to 
solve, you may want to prohibit flake8 from pointing out certain errors or 
violations.

[image: Bild 2021-10-03 kl. 21.19.jpg]

So I tried to improve the built-in regular expression as documented in the 
man page.

Not being an regex expert myself, I failed to include the warning or error 
ID in the type group and somehow tack it on later for the msg part… Here is 
my go at it, which only slightly improves the situation by including the 
numerical part of the ID in the msg.

'(?P<file>.+?):(?P<line>\d+):(?P<col>\d+):\s+*(?P<type>[EWF](?=\d+))*
(?P<msg>.*)$'

[image: Bild 2021-10-03 kl. 21.32.jpg]

It’s far from ideal, but at least you know that if a violation is an Error, 
you stick an ’E’ in front of the numerical ID to get the complete code, ’W’ 
for a warning, and most likely an ’F’ for a note.

Another option is of course to fall back to using the default parser in 
bbresults, but the resulting output is a bit bleak as all entries are now 
notes:

[image: Bild 2021-10-03 kl. 21.39.jpg]

Anyone out there with a better idea?

Best regards,
Johan

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/56b0b4bf-8640-4cc5-bea3-c40b8563e8d2n%40googlegroups.com.

Reply via email to