-
Notifications
You must be signed in to change notification settings - Fork 274
Feature banner helper #3920
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
Feature banner helper #3920
Conversation
While you're at it, maybe fix the copyright dates? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
3bad5ab
to
2f7df5d
Compare
@smowton I purposefully avoided messing with the copyright notices in any way because that's an issue I'd rather not deal with, if it was determined that they need changing I'd rather have that done separate from this work |
Basically I agree with Hannes on this one: as a PR that just reformats the strings, it should only do just that. Changing the content of the strings, however trivial, in my opinion belongs to another PR. |
src/util/parse_options.cpp
Outdated
std::string | ||
banner_string(const std::string &front_end, const std::string &version) | ||
{ | ||
static_assert(CHAR_BIT == 8, | ||
"we do make the fairly safe assumption of 8 bit bytes"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#917 :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, I'll remove it. In this case the worst that can happen is odd numbers in the -bits
section anyway 🤷♀️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry, I did not necessarily want you to feel compelled to remove it. Was just meaning to say that there is existing work to clean this up.
unit/Makefile
Outdated
@@ -56,6 +56,7 @@ SRC += analyses/ai/ai.cpp \ | |||
util/message.cpp \ | |||
util/optional.cpp \ | |||
util/optional_utils.cpp \ | |||
util/parse_options.cpp \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space vs tabs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♀️
unit/util/parse_options.cpp
Outdated
#include <testing-utils/use_catch.h> | ||
#include <util/parse_options.h> | ||
|
||
TEST_CASE("align_center_with_border", "[core][util]") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{
on new line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
2f7df5d
to
ef956a9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we use left-pad :-D
ef956a9
to
8a99323
Compare
Slight change: There was a potential underflow bug if the total length of the banner text exceeded the expected total length of the banner. The "fill" now can't be lower than 0. |
8a99323
to
ea62b6d
Compare
ea62b6d
to
55a8e61
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫
This PR failed Diffblue compatibility checks (cbmc commit: 55a8e61).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/98597198
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.
test-gen failure appears to be unrelated to this PR |
55a8e61
to
b7a33ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫
This PR failed Diffblue compatibility checks (cbmc commit: b7a33ba).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/98634346
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.
…to_harness_stub Add stub for new goto-harness tool [depends-on: #3920]
This adds a small helper function, to help with writing banners like
which we do for our tools. Also updates all our help messages to use the helper.