Skip to content
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

Add nowarn=:all option to @check and check #32

Merged
merged 3 commits into from
Aug 23, 2019
Merged

Add nowarn=:all option to @check and check #32

merged 3 commits into from
Aug 23, 2019

Conversation

DilumAluthge
Copy link
Contributor

@DilumAluthge DilumAluthge commented Aug 23, 2019

Related to #6. Closes #21.

Currently, there are two ways to ask check/@check to throw an error if any warnings occur inside a function:

  • Annotate the function definition with the @should_not_warn macro.
  • Provide a list of functions in the nowarn keyword argument to check/@check. Example usage: @check f(x,y,z) nowarn=[g,h]

This pull request adds a third option:

  • Set nowarn=:all, which tells check/@checkto throw an error if any warnings occur inside ANY function. Example usage: @check f(x) nowarn=:all

The first two options remain available.

Motivation

The first option (annotating with @should_not_warn) requires that you manually annotate all of the functions of interest. This can be cumbersome. Additionally, this requires that you make Traceur.jl a required dependency of your package, instead of a test-only dependency.

The second option (providing a list of functions in nowarn) requires that you manually list out all of the functions of interest. This can also be cumbersome.

The third option added in this pull request (setting nowarn=:all) is quick and easy.

@DilumAluthge
Copy link
Contributor Author

cc: @NHDaly

Copy link
Member

@pfitzseb pfitzseb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

src/check.jl Outdated Show resolved Hide resolved
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.

2 participants