Skip to content

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

Conversation

hannes-steffenhagen-diffblue
Copy link
Contributor

This adds a small helper function, to help with writing banners like

**              this             **

which we do for our tools. Also updates all our help messages to use the helper.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

@smowton
Copy link
Contributor

smowton commented Jan 24, 2019

While you're at it, maybe fix the copyright dates?

Copy link
Contributor

@NlightNFotis NlightNFotis left a 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.

@hannes-steffenhagen-diffblue
Copy link
Contributor Author

@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

@NlightNFotis
Copy link
Contributor

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.

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");
Copy link
Collaborator

Choose a reason for hiding this comment

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

#917 :-)

Copy link
Contributor Author

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 🤷‍♀️

Copy link
Collaborator

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 \
Copy link
Collaborator

Choose a reason for hiding this comment

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

Space vs tabs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤦‍♀️

#include <testing-utils/use_catch.h>
#include <util/parse_options.h>

TEST_CASE("align_center_with_border", "[core][util]") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

{ on new line?

Copy link
Contributor

@danpoe danpoe left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@martin-cs martin-cs left a 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

@hannes-steffenhagen-diffblue
Copy link
Contributor Author

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.

Copy link
Contributor

@allredj allredj left a 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.

@hannes-steffenhagen-diffblue
Copy link
Contributor Author

test-gen failure appears to be unrelated to this PR

Copy link
Contributor

@allredj allredj left a 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.

@NlightNFotis NlightNFotis merged commit f6f7ecd into diffblue:develop Jan 25, 2019
hannes-steffenhagen-diffblue added a commit that referenced this pull request Jan 26, 2019
…to_harness_stub

Add stub for new goto-harness tool [depends-on: #3920]
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.

8 participants