Skip to content

Add support in the diagnostic verifier for verifying no fix-its #674

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

Merged
merged 1 commit into from
Dec 23, 2015

Conversation

gregomni
Copy link
Contributor

Checked what it would look like to verify fix-its in every case, and
currently the tests are missing expected fix-its in 435 diagnoses in 60
test files.

So as an alternative, added support for a no fix-its marker “{{}}”, and
added that marker to the c-style for deprecation tests where it applies.

See conversation in #552 for the motivation for this change.

@gribozavr
Copy link
Contributor

I'd prefer something more explicit than {{}} to mean "expect no fix-its", but the direction seems useful to me.

@gregomni
Copy link
Contributor Author

The text "expected-no-fix-its" is the most explicit way I can think of, but it has the disadvantage of looking like a top-level expected diagnostic instead of a modifier to the previous expected diagnostic. Or make it part of the diagnoses kind, e.g. "expected-warning-no-fix-its"?

As I think of various other possibilities I still like "{{}}". It's in the position of a fix-it, it looks like a fix-it, but it's empty. I think syntactically, it's closest to the intended semantics.

That being said, I'm happy to change to whatever syntax.

@jrose-apple
Copy link
Contributor

:-/ I see why you went with {{}}, but I think I agree with Dmitri that it's not clear enough. I don't really like tacking it on to the "expected" part, though. Some ideas:

  • {{none}} - still a little ambiguous if you don't know about fix-it check syntax.
  • {{no-fix-its}} - more explicit but starting to get wordy
  • Invert the polarity and require {{*}} to ignore fix-its - I don't think this'll fly with the team.

Hm. I don't like any of these.

@lattner
Copy link
Contributor

lattner commented Dec 21, 2015

{{none}} seems servicable to me.

@gregomni
Copy link
Contributor Author

Alrighty. Switched to {{none}}, committed, squashed.

@jrose-apple
Copy link
Contributor

Other than the one comment issue, this looks good to me!

@gregomni
Copy link
Contributor Author

Oops! Yep, fixed that.

Checked what it would look like to verify fix-its in every case, and
currently the tests are missing expected fix-its in 435 diagnoses in 60
test files.

So as an alternative, added support for a no fix-its marker “{{none}}”, and
added that marker to the c-style for deprecation tests where it applies.
@gregomni
Copy link
Contributor Author

(Fixed conflicts with another commit adding warnings for use of ++ to the tests, repushed.)

jrose-apple added a commit that referenced this pull request Dec 23, 2015
Add support in the diagnostic verifier for verifying no fix-its.
@jrose-apple jrose-apple merged commit bd3be45 into swiftlang:master Dec 23, 2015
@jrose-apple
Copy link
Contributor

Thanks, Greg!

@gregomni gregomni deleted the verify-no-fixits branch January 24, 2016 17:45
freak4pc pushed a commit to freak4pc/swift that referenced this pull request Sep 28, 2022
[Stress tester XFails] Update XFails
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.

4 participants