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.
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>.*)$'
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:
Anyone out there with a better idea?
Best regards,
Johan