Skip to content

Use standard file:line: level: message format - #711

Merged
JukkaL merged 1 commit into
python:masterfrom
o11c:standard-error-format
Jun 23, 2015
Merged

JukkaL merged 1 commit into
python:masterfrom
o11c:standard-error-format

Conversation

@o11c

@o11c o11c commented Jun 13, 2015

Copy link
Copy Markdown
Contributor

There is a standard format for errors and warnings. Using it means better integration for other tools.

file:line:col: level: message [-option]

file must be absolute or relative to the current working directory.
line is 1-based and any line without it is not considered for the protocol.
col is 1-based may be omitted. It should probably always be omitted if something like C's #file is used to replace the file/line that the compiler sees with the file/line of the program that emitted that source file.
level may be error or warning to receive special handling in editors, or anything else (commonly note for multi-location errors/warnings) or omitted to not be collected specially. Essentially this is part of message in those cases.
[-option] is the command-line argument used to enable a warning, and may be omitted. This is essentially part of message for all programmatic purposes, but useful for humans.

Programs such as gcc and make produce this format; IDEs and text editors such as vim and kate consume it. There are doubtless uncountably many more programs that also use the same protocol.

@refi64

refi64 commented Jun 13, 2015

Copy link
Copy Markdown
Contributor

+1. Howl also supports this format.

@o11c
o11c force-pushed the standard-error-format branch from ea979d1 to 654d63b Compare June 13, 2015 06:18
@o11c

o11c commented Jun 13, 2015

Copy link
Copy Markdown
Contributor Author

Patch is a little more complex now that I'm dealing with the unit tests. Not unit test framework I'm familiar with.

This gives better tool integration.
@o11c
o11c force-pushed the standard-error-format branch from 654d63b to 7c0125c Compare June 15, 2015 04:26
@o11c

o11c commented Jun 15, 2015

Copy link
Copy Markdown
Contributor Author

@JukkaL This PR is particularly prone to getting outdated.

@o11c

o11c commented Jun 19, 2015

Copy link
Copy Markdown
Contributor Author

@JukkaL ping? Not having this merged makes it significantly harder to write future patches reliably.

@o11c o11c mentioned this pull request Jun 20, 2015
@JukkaL

JukkaL commented Jun 23, 2015

Copy link
Copy Markdown
Collaborator

Thanks for implementing this, and sorry for the delay!

It's a good idea to move towards a more standard format for messages. We should still continue improving the messages by including column numbers and showing the actual source code lines containing errors.

JukkaL added a commit that referenced this pull request Jun 23, 2015
Use standard `file:line: level: message` format
@JukkaL
JukkaL merged commit 1ba92f4 into python:master Jun 23, 2015
@presidento

Copy link
Copy Markdown

Thank you @JukkaL for merging this.

@o11c
o11c deleted the standard-error-format branch June 23, 2015 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants