-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
More consistently print requested file name in errors #1274
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1274 +/- ##
==========================================
+ Coverage 88.47% 88.49% +0.01%
==========================================
Files 63 63
Lines 9262 9262
==========================================
+ Hits 8195 8196 +1
+ Misses 1067 1066 -1
|
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.
Great! And stancjs already handled this.
Not important for now but I noticed the docstring for Location.to_string
says
If printed_filename is passed, it will replace the filename printed for this Location.t and all recursively included ones.
and I think that the recursive part is a bad idea; overriding the names of #include
d files has potential for some confusing messages.
@nhuurre good catch - that behavior also isn't tested! I've added a test and changed it so that the argument only affects the top-level name (e.g. the file passed on the command line), rather than all of them. For context, I'm particularly interested in this for things like ivan-bocharov/stan-vscode#11, which sometimes needs to run the compiler on a temporary file. It's nice to print the original name in the error if so. |
Thanks, but the docstring needs to change too. |
Submission Checklist
Release notes
Improved
--filename-in-msg
for the command line version ofstanc
. Errors now use the requested name, not just warnings.Copyright and Licensing
By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the BSD 3-clause license (https://opensource.org/licenses/BSD-3-Clause)