Skip to content

Conversation

@heinezen
Copy link
Member

@heinezen heinezen commented Aug 17, 2025

Updates the clang format rules to a newer clang-format version. I also tried to sync the rules with the openage formatting (see here).

@heinezen heinezen added the improvement improves existing functionality label Aug 17, 2025
@heinezen
Copy link
Member Author

I'm waiting for #125 on this one, in case that needs reformatting.

@heinezen heinezen force-pushed the chore/clang_format_update branch from 3c0b06c to 44ef5ff Compare August 18, 2025 13:54
@heinezen heinezen marked this pull request as ready for review August 18, 2025 13:55
if (unlikely(member_info.is_initial_def())) {
// another parent defines this type,
// which is disallowed!
// which is disallowed!
Copy link
Member

Choose a reason for hiding this comment

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

this should remain one-tab indented, just like the line before.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tested why this is happening and it looks like this is the trade-off of turning ReflowComments on. The multi-line block comments are formatted correctly now (with tabs), but multiple single-line comments get converted to spaces for whatever reason.

Copy link
Member

Choose a reason for hiding this comment

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

oh dear. that surely seems like a bug then. so far i couldn't find an upstream report about this...

Copy link
Member Author

Choose a reason for hiding this comment

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

seems like a bad interaction of ReflowComments and UseTabs...

}
// else that member knows the type,
// but we're looking for the initial definition.
// but we're looking for the initial definition.
Copy link
Member

Choose a reason for hiding this comment

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

same here

target_obj->apply(
// TODO: use the same mechanism as above to get only parent
// obj states of base_state
// obj states of base_state
Copy link
Member

Choose a reason for hiding this comment

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

same, should remain the tab.


// explicit instantiations
template class Number<value_int_t>; // Int
template class Number<value_int_t>; // Int
Copy link
Member

Choose a reason for hiding this comment

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

same here, comment lineup is likely bad

INF_POS, //!< set this to positive infinite
INF_NEG, //!< set this to negative infinite
ZERO, //!< set this to zero
ZERO, //!< set this to zero
Copy link
Member

Choose a reason for hiding this comment

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

same here

@heinezen heinezen force-pushed the chore/clang_format_update branch 4 times, most recently from 3011ade to 40f41fb Compare September 14, 2025 03:39
@heinezen heinezen force-pushed the chore/clang_format_update branch from 40f41fb to 3e4fb5a Compare September 14, 2025 03:41
@heinezen
Copy link
Member Author

I fixed everything I could. About the spaces in the indentation of the comments: Let's accept that these exist because ReflowComments is pretty valuable and wait for clang-format to fix the bug. I'll create an issue in their repo.

@TheJJ
Copy link
Member

TheJJ commented Sep 14, 2025

Great, thanks!

@TheJJ TheJJ merged commit f462a1f into SFTtech:master Sep 14, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement improves existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants