Skip to content
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

Align qualifiers using clang-format #2647

Merged
merged 4 commits into from
Jan 28, 2023

Conversation

AntoinePrv
Copy link
Contributor

@AntoinePrv AntoinePrv commented Jan 27, 2023

Checklist

  • The title and commit message(s) are descriptive.
  • Small commits made to fix your PR have been squashed to avoid history pollution.
  • Tests have been added for new features or bug fixes.
  • API of new functions and classes are documented.

Description

This option is experimental, let's see if it works.

@@ -67,6 +67,8 @@ PenaltyBreakTemplateDeclaration: 0
PenaltyExcessCharacter: 10
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 10
QualifierAlignment: Custom # Experimental
QualifierOrder: [inline, static, constexpr, const, volatile, type]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JohanMabille @tdegeus here is the setting for the ordering.
I'm happy to change it to east-const if you'd like ;)

Copy link
Member

Choose a reason for hiding this comment

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

Very nice, makes the code significantly more readable!

Copy link
Member

Choose a reason for hiding this comment

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

no way ;)

@tdegeus
Copy link
Member

tdegeus commented Jan 27, 2023

Is .clang-format yaml ? Could an automatic tool keep it formatted?

@AntoinePrv
Copy link
Contributor Author

It is Yaml indeed. Perhaps we can the file explicitly to the yaml pre-commit hooks.

@tdegeus
Copy link
Member

tdegeus commented Jan 27, 2023

That would be great indeed!

@AntoinePrv
Copy link
Contributor Author

This seems to do the trick, but it seems to not be a hook for sorting yaml (which is probably better, sorting is not always a good fit for configs).

@JohanMabille JohanMabille merged commit 38b292f into xtensor-stack:master Jan 28, 2023
@AntoinePrv AntoinePrv deleted the qualifier-alignment branch February 15, 2023 12:54
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.

3 participants