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

Fix in validation so that warnings are not reported as errors #1643

Merged
merged 1 commit into from
Mar 13, 2023

Conversation

petervdonovan
Copy link
Collaborator

@petervdonovan petervdonovan commented Mar 12, 2023

This does not change the output of lfc even when an error appears in an imported reactor.

The code just was not doing much except for redundant work, since it was being invoked after a round of validation checks had already passed. Actually it was even worse than that, because it was running the validator without the right ValidationIssueAcceptor injected, resulting in behavior that was not consistent with that implemented in StandaloneIssueAcceptor. This is why warnings were (wrongly) being converted to errors.

I decided to delete the method in GeneratorUtils rather than a) make this code work properly and b) spend some unknown number of hours fighting with Guice. I think this is an acceptable solution because it is doubtful whether the behavior that the method was supposed to implement is what we want. Specifically, if an error is reported on an imported reactor, it is not obvious to me that the error should also be reported on import statements that import the reactor.

This does not change the output of `lfc` even when an error appears in
an imported reactor. The code just was not doing what it was claiming to
be doing AFAICT other than redundant work, since it was being invoked
after a round of validation checks had already passed. And it is even
worse than that, because it was running the validator without the right
ValidationIssueAcceptor injected, resulting in behavior that was not
consistent with that implemented in StandaloneIssueAcceptor. I decided
to delete the whole thing rather than a) make this code work properly
and b) spend some unknown number of hours fighting with Guice. The fact
is that it is doubtful whether the behavior that it was supposed to have
is even what we want. I am not sure that users really need their import
statements to be highlighted with errors reported on the imported
reactors.
@petervdonovan petervdonovan changed the title Do not report warnings as errors. Fix in validation so that warnings are not reported as errors Mar 12, 2023
@petervdonovan petervdonovan requested a review from cmnrd March 12, 2023 06:52
@lhstrh
Copy link
Member

lhstrh commented Mar 13, 2023

Looks reasonable to me...

Copy link
Collaborator

@cmnrd cmnrd left a comment

Choose a reason for hiding this comment

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

Thanks! I also noticed recently that the validation runs twice, but I didn't know why until now.

@cmnrd cmnrd merged commit 27d135b into master Mar 13, 2023
@cmnrd cmnrd deleted the do-not-report-warnings-as-errors branch March 13, 2023 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants