-
-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement issue 20515: add command line flag to allow selecting GNU message style for errors and warnings. #10732
Implement issue 20515: add command line flag to allow selecting GNU message style for errors and warnings. #10732
Conversation
|
Thanks for your pull request and interest in making D better, @FeepingCreature! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + dmd#10732" |
5873c6c to
544741c
Compare
096e704 to
7aa7cbd
Compare
|
sorry for the spam, c++ interop wouldn't go |
0fa96d3 to
2af15c8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might even want to add -verrors=context to this new flag as it's similarly just about the formatting style.
src/dmd/cli.d
Outdated
| @@ -641,6 +641,12 @@ dmd -cov -unittest myprog.d | |||
| Option("vcolumns", | |||
| "print character (column) numbers in diagnostics" | |||
| ), | |||
| Option("verror-style=digitalmars", | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Option("verror-style=digitalmars", | |
| Option("verror-style=[digitalmars|gnu|?]", |
See the other options.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better? Not sure '?' is worth it here, the options are fairly self-explanatory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most DMD options have a help page that lists all available options.
the options are fairly self-explanatory.
Fair enough.
515361d to
013007a
Compare
|
@wilzbach not sure what you mean with "add |
It's an existing output error style: It would fit more with the new flag. |
|
I get what it is, I don't know what you mean by "fit more with the new flag". edit: Do you mean |
|
ping @wilzbach |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have a changelog entry ? Many people probably want to add that to their dmd.conf. I know I do.
src/dmd/mars.d
Outdated
| else if (strcmp(style, "gnu") == 0) | ||
| params.messageStyle = MessageStyle.gnu; | ||
| else | ||
| error("unknown error style '%s'", style); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
List possible style
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Listed.
…essage style for errors and warnings.
013007a to
09a1a38
Compare
|
Added a changelog entry. |
|
Done. (N.B 72h merge stoped sef-merging a while ago) |
The one that you introduce. |
|
Ah, I finally understand. I'm not sure that's a good idea, as it seems to do a very different thing? So we'd need to do it "feature flag" style, ie something like |
Sorry about that.
It never did that. A merge should always be a conscious decision. You can get a list of all of them easily over all repos e.g. via https://github.com/pulls?utf8=%E2%9C%93&q=is%3Aopen+is%3Apr+org%3Adlang+label%3A%2272h+no+objection+-%3E+merge%22
IMHO it's more an
Yeah we would, what do other people think about this? |
I don't think this is a good idea because feature flags should IMHO accept any subset of all possible values. That would imply |
This should ease interoperability with existing IDEs.
The GNU style is documented at https://www.gnu.org/prep/standards/html_node/Errors.html