Skip to content

[main] Mass-apply clang-format 20.1.8 (fixes #387) - #393

Open
hartwork wants to merge 3 commits into
taocpp:mainfrom
hartwork:main-clang-format
Open

[main] Mass-apply clang-format 20.1.8 (fixes #387)#393
hartwork wants to merge 3 commits into
taocpp:mainfrom
hartwork:main-clang-format

Conversation

@hartwork

Copy link
Copy Markdown
Contributor

Fixes #387

CC @ColinH

@ColinH ColinH left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Most changes are fine, but some are not what I want the code to look like and should be removed, of which I flagged a few examples.

{
const std::vector< example::my_token > v{
{ example::my_type::beta, "first" },
{ example::my_type::beta, "first" },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is strange and not right, same in token_input_2.cpp.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ColinH that's actually feature "vertical alignment" at work:

screen

It can be disabled via the config file. It it not a bug, as far as I can tell.

using eolof_grammar = until< at< sor< eof, eol_rule > > >;
const data_t* p = previous( pos ); // TODO: Start earlier?
const std::size_t s = ( std::min )( max, std::size_t( this->end() - p ) );
const std::size_t s = (std::min)( max, std::size_t( this->end() - p ) );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This does not fit with the general style.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ColinH that's current explicit config SpacesInCStyleCastParentheses: false at work. clang-format does as the current config is asking it to:

SpacesInCStyleCastParentheses: false

@hartwork hartwork Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ColinH I have now flipped the option for true in a second commit and re-applied mass-formatting as a third. So you can see the effect in isolation.

}
}, v.data );
},
v.data );

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This doesn't make sense.

@hartwork hartwork Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ColinH it's a actually a vertical alignment feature at work:

screen

It's a matter of finding the right knob and seeing if it's other options feel more natural.

@hartwork

Copy link
Copy Markdown
Contributor Author

@ColinH I addressed your findings one by one above. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Need help with fixing the clang-format CI?

2 participants