Skip to content

clang-tidy: use auto #43

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

Merged
merged 1 commit into from
Jul 9, 2022
Merged

clang-tidy: use auto #43

merged 1 commit into from
Jul 9, 2022

Conversation

neheb
Copy link
Contributor

@neheb neheb commented Jul 5, 2022

Found with modernize-use-auto

Signed-off-by: Rosen Penev rosenp@gmail.com

@kjellahl
Copy link
Collaborator

kjellahl commented Jul 6, 2022

Even though I'm not a fan of using auto wherever possible, these uses of auto
are okay. Unfortunately the commit also contains format changes that I don't like.

Curly brackets shall be on lines by themselves when they delimit a block of statements.

if (...)
{
  ...
}
else
{
  ...
}

instead of

if (...) {
  ...
} else {
  ...
}

The asterisk that denotes a pointer goes with the type name, not with the variable name.
int* pi instead of int *pi. More relevant to your commit: static_cast<std::istream*>(context)
instead of static_cast<std::istream *>(context).
You may or may not like these formatting rules. No one likes all rules, but the
formatting shall be consistent in code that many people change.

Found with modernize-use-auto

Signed-off-by: Rosen Penev <rosenp@gmail.com>
@neheb
Copy link
Contributor Author

neheb commented Jul 6, 2022

Fixed.

The previous formatting was done by clang-format.

@kjellahl kjellahl merged commit dc6e3b4 into libxmlplusplus:master Jul 9, 2022
@kjellahl
Copy link
Collaborator

kjellahl commented Jul 9, 2022

The previous formatting was done by clang-format.

clang-format formats as you request it to format. The result can be controlled
with a .clang-format configuration file.

@neheb neheb deleted the 5 branch July 9, 2022 07:46
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.

2 participants