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 Issue 21738 - std.format.spec: singleSpec should throw on "%%" #7894

Merged
merged 1 commit into from Mar 23, 2021

Conversation

wolframw
Copy link
Contributor

singleSpec doesn't work with "%%" since it doesn't really "do" anything. Therefore, singleSpec is changed to throw a FormatException if "%%" is passed as format specifier.

@dlang-bot
Copy link
Contributor

dlang-bot commented Mar 20, 2021

Thanks for your pull request and interest in making D better, @wolframw! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Auto-close Bugzilla Severity Description
21738 minor std.format.spec: singleSpec should throw on "%%"

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + phobos#7894"

Copy link
Contributor

@berni44 berni44 left a comment

Choose a reason for hiding this comment

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

You need to reword the commit message to start with "Fix issue 21738". So the bot will auto close the issue. All else is fine.

A `FormatException` when more than one specifier is given or the specifier
is malformed.
A `FormatException` when more than one specifier is given, the specifier
is malformed, or when the specifier is "%%".
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
is malformed, or when the specifier is "%%".
is malformed or when the specifier is "%%".

Copy link
Contributor

Choose a reason for hiding this comment

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

With #7891 being merged, this isn't relevant anymore. There are more cases, where a FormatException can be thrown, so I used a more general term there and there is no need any more to write anything about %%.

But: When handling the merge conflicts, the "Known Bug" section should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the heads-up.

@wolframw wolframw changed the title Issue 21738 - std.format.spec: singleSpec should throw on "%%" Fix Issue 21738 - std.format.spec: singleSpec should throw on "%%" Mar 22, 2021
@RazvanN7 RazvanN7 closed this Mar 23, 2021
@RazvanN7 RazvanN7 reopened this Mar 23, 2021
@dlang-bot dlang-bot merged commit 3c26055 into dlang:master Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants