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 Mail.require_silently for parser warnings #1557

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

skipkayhil
Copy link

Summary

Previously, requiring parsers emitted a number of unused variable and unreachable statement warnings. The unused variable warnings are simple to fix (see skipkayhil/mail@8dd1655), but the unreachable statements do not seem to be.

Since it seems like its difficult to make Ragel generated parsers not emit any warnings, this commit adds a helper method that wraps require and silences the warnings emitted. The changes to $VERBOSE in the parsers added in 7ef5694 unfortunately do not help as the warnings are emitted on parse and not when evaluating the files.

Additional Information

Ref: #1551

If the method is overkill but the approach is reasonable, I can also change this to just add the warning silencing to the individual requires since there are only 16.

Previously, requiring parsers emitted a number of unused variable and
unreachable statement warnings. The unused variable warnings are simple
to fix (see 8dd1655),
but the unreachable statements do not seem to be.

Since it seems like its difficult to make Ragel generated parsers not
emit any warnings, this commit adds a helper method that wraps require
and silences the warnings emitted. The changes to $VERBOSE in the
parsers added in 7ef5694 unfortunately
do not help as the warnings are emitted on parse and not when evaluating
the files.
skipkayhil added a commit to skipkayhil/rails that referenced this pull request Feb 23, 2023
Previously, requiring any of the ragel generated parsers in mail would
output tons of warnings in tests, making output much harder to read
(especially in Railties).

This commit extends the RaiseWarnings patch to suppress output from
these mail parsers.

The suppression can be removed once mikel/mail#1557 or mikel/mail#1551
or any other PR fixes the issue
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.

None yet

1 participant