-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fixes #20149; fixes #16762; hintAsError and warningAsError now ignore foreign packages #20151
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
542d980
fixes #20149; hintAsError/warningAsError ignores foreign packages
ringabout b41118a
add changelog
ringabout 278c41a
fixes the test
ringabout aee6be1
remove
ringabout bd42490
fixes tests again
ringabout 71de68a
fix
ringabout 2302ad8
I'm careless
ringabout a3dda8e
Merge branch 'devel' into pr_warnings
ringabout File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
let x = 12 | ||
echo x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -232,6 +232,11 @@ sub/mmain.idx""", context | |
let cmd = fmt"{nim} r -b:cpp --hints:off --nimcache:{nimcache} --warningAsError:ProveInit {file}" | ||
check execCmdEx(cmd) == ("witness\n", 0) | ||
|
||
block: # bug #20149 | ||
let file = testsDir / "misc/m20149.nim" | ||
let cmd = fmt"{nim} r --hints:off --nimcache:{nimcache} --hintAsError:XDeclaredButNotUsed {file}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll still approve this, but would like to note that this will break if |
||
check execCmdEx(cmd) == ("12\n", 0) | ||
|
||
block: # config.nims, nim.cfg, hintConf, bug #16557 | ||
let cmd = fmt"{nim} r --hint:all:off --hint:conf tests/newconfig/bar/mfoo.nim" | ||
let (outp, exitCode) = execCmdEx(cmd, options = {poStdErrToStdOut}) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
What meaning does it have for
msg in conf.warningAsErrors
to be true? What would a boolean that contained the result of that statement be accurately be named like?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.
Sounds good to me. Feel free to add a test case in the following up prs.
Yeah, there are tests for that. Using compiles should work for simple cases. If you can also go through the trouble of using execCmdEx and compare the outputs. Following-up prs are welcome!
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.
conf.warningAsErrors
is a set of TMsgKind enum type. If msg in theconf.warningAsErrors
, it means this hints/warnings are enabled for the file and you have already specified that hints/warnings should be errors.For instance, for a module within the current package,
XDeclaredButNotUsed
is enabled. If you also specify--hintAsError:XDeclaredButNotUsed
is true, in this caseXDeclaredButNotUsed
is the msg variable,--hintAsError:XDeclaredButNotUsed
meansXDeclaredButNotUsed
is added toconf.warningAsErrors
. So the statement "msg in conf.warningAsErrors" is true.For a foreign package,
XDeclaredButNotUsed
is not enabled by default. Even if--hintAsError:XDeclaredButNotUsed
is specified, the statement "msg in conf.warningAsErrors" is false.