Reapply clang-format. by BillyDonahue · Pull Request #867 · open-source-parsers/jsoncpp (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation4 Commits1 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

@BillyDonahue

  $ clang-format -i -style=file \
        <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo stretchy="false">(</mo><mi>f</mi><mi>i</mi><mi>n</mi><mi>d</mi><mi mathvariant="normal">.</mi><mi mathvariant="normal">∣</mi><mi>e</mi><mi>g</mi><mi>r</mi><mi>e</mi><msup><mi>p</mi><mo mathvariant="normal" lspace="0em" rspace="0em">′</mo></msup><mi mathvariant="normal">.</mi><mo>∗</mo><mover accent="true"><mo stretchy="false">(</mo><mo>˙</mo></mover><mi>h</mi><mi mathvariant="normal">∣</mi><mi>c</mi><mi>p</mi><mi>p</mi><mi mathvariant="normal">∣</mi><mi>i</mi><mi>n</mi><mi>l</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">(find  . | egrep &#x27;.*\.(h|cpp|inl)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.0019em;vertical-align:-0.25em;"></span><span class="mopen">(</span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mord mathnormal">in</span><span class="mord mathnormal">d</span><span class="mord">.∣</span><span class="mord mathnormal">e</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mord mathnormal">re</span><span class="mord"><span class="mord mathnormal">p</span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.7519em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mtight"><span class="mord mtight">′</span></span></span></span></span></span></span></span></span><span class="mord">.</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">∗</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1.2369em;vertical-align:-0.25em;"></span><span class="mord accent"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.9869em;"><span style="top:-3em;"><span class="pstrut" style="height:3em;"></span><span class="mopen">(</span></span><span style="top:-3.319em;"><span class="pstrut" style="height:3em;"></span><span class="accent-body" style="left:-0.1389em;"><span class="mord">˙</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.25em;"><span></span></span></span></span></span><span class="mord mathnormal">h</span><span class="mord">∣</span><span class="mord mathnormal">c</span><span class="mord mathnormal">pp</span><span class="mord">∣</span><span class="mord mathnormal">in</span><span class="mord mathnormal" style="margin-right:0.01968em;">l</span><span class="mclose">)</span></span></span></span>')

Also did some manual commenting to keep test data lines from joining up,
since they rely on __LINE__ to be meaningful.

@BillyDonahue

$ clang-format -i -style=file
(find.∣egrep′.∗(˙h∣cpp∣inl)(find . | egrep '.*.(h|cpp|inl)(find.∣egrep.(˙hcppinl)')

BillyDonahue

void setComment(const char* text, size_t len);
char* comment_{nullptr};
char* comment_{ nullptr };

Choose a reason for hiding this comment

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

I don't really like this behavior, but it's what our .clang-format specifies so we'd better either accept it or change our .clang-format file.

Choose a reason for hiding this comment

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

I have no preference, except for consistency. The status-quo is fine.

I'll also use clang-format in the future to maintain style consistency.

BillyDonahue

JSONCPP_STRING in;
};
const TestData test_data[] = {
{ __LINE__, true, "{\"a\":9}" }, { __LINE__, false, "{\"a\":0Infinity}" },

Choose a reason for hiding this comment

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

These obviously need to all be on their own row. The EOL comments tell clang-format not to join them.

Choose a reason for hiding this comment

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

+1

hjmjohnson

void setComment(const char* text, size_t len);
char* comment_{nullptr};
char* comment_{ nullptr };

Choose a reason for hiding this comment

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

I have no preference, except for consistency. The status-quo is fine.

I'll also use clang-format in the future to maintain style consistency.

JSONCPP_STRING in;
};
const TestData test_data[] = {
{ __LINE__, true, "{\"a\":9}" }, { __LINE__, false, "{\"a\":0Infinity}" },

Choose a reason for hiding this comment

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

+1

2 participants

@BillyDonahue @hjmjohnson