tweaks: condense and correct a comment, and move another
Since commit 5dcf375f
from four years ago, a linter message must
contain a colon followed by a space for it to be recognized as a
linter message.
master
parent
44fb3e9991
commit
07fd4c4598
|
@ -2631,10 +2631,10 @@ void do_linter(void)
|
||||||
|
|
||||||
block_sigwinch(FALSE);
|
block_sigwinch(FALSE);
|
||||||
|
|
||||||
/* Process the linter output. */
|
|
||||||
pointer = lintings;
|
pointer = lintings;
|
||||||
onelint = lintings;
|
onelint = lintings;
|
||||||
|
|
||||||
|
/* Now parse the output of the linter. */
|
||||||
while (*pointer != '\0') {
|
while (*pointer != '\0') {
|
||||||
if ((*pointer == '\r') || (*pointer == '\n')) {
|
if ((*pointer == '\r') || (*pointer == '\n')) {
|
||||||
*pointer = '\0';
|
*pointer = '\0';
|
||||||
|
@ -2642,11 +2642,8 @@ void do_linter(void)
|
||||||
char *filename = NULL, *linestr = NULL, *maybecol = NULL;
|
char *filename = NULL, *linestr = NULL, *maybecol = NULL;
|
||||||
char *message = copy_of(onelint);
|
char *message = copy_of(onelint);
|
||||||
|
|
||||||
/* At the moment we handle the following formats:
|
/* The recognized format is "filename:line:column: message",
|
||||||
*
|
* where ":column" may be absent or be ",column" instead. */
|
||||||
* filenameorcategory:line:column:message (e.g. splint)
|
|
||||||
* filenameorcategory:line,column:message (e.g. pylint)
|
|
||||||
* filenameorcategory:line:message (e.g. pyflakes) */
|
|
||||||
if (strstr(message, ": ") != NULL) {
|
if (strstr(message, ": ") != NULL) {
|
||||||
filename = strtok(onelint, ":");
|
filename = strtok(onelint, ":");
|
||||||
if ((linestr = strtok(NULL, ":")) != NULL) {
|
if ((linestr = strtok(NULL, ":")) != NULL) {
|
||||||
|
|
Loading…
Reference in New Issue