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

apply clang-format v15.0.7 and .clang-format@d8f14fdd #2662

Merged
merged 2 commits into from
Mar 22, 2023
Merged

Conversation

dschwoerer
Copy link
Contributor

In order to avoid merge-conflicts, I run clang-format to the whole code base, but I noticed this was not consistently done for next.

That is the code I used:

git checkout d8f14fdddb5ca0fbb32d8e2bf5ac2960d6ac5ce6 -- .clang-format
clang-format --version # should be 15.0.7 - comes with fedora 37                                                                                                                                                                             
clang-format -i $(git ls-tree --full-tree -r --name-only HEAD|grep xx\$)
git checkout origin/next -- tests/integrated/test-drift-instability-staggered/2fluid.cxx .clang-format
git commit -a -m 'apply clang-format v15.0.7 with .clang-format@d8f14fdd'

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

I = 0.0; // I disappears from metric
}
}

//////////////////////////////////////////////////////////////
// NORMALISE QUANTITIES

if (mesh->get(Bbar, "bmag")) // Typical magnetic field
if (mesh->get(Bbar, "bmag")) { // Typical magnetic field
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: implicit conversion 'int' -> bool [readability-implicit-bool-conversion]

Suggested change
if (mesh->get(Bbar, "bmag")) { // Typical magnetic field
if (mesh->get(Bbar, "bmag") != 0) { // Typical magnetic field

Bbar = 1.0;
if (mesh->get(Lbar, "rmag")) // Typical length scale
}
if (mesh->get(Lbar, "rmag")) { // Typical length scale
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: implicit conversion 'int' -> bool [readability-implicit-bool-conversion]

Suggested change
if (mesh->get(Lbar, "rmag")) { // Typical length scale
if (mesh->get(Lbar, "rmag") != 0) { // Typical length scale

@@ -661,8 +673,9 @@
//ddt(Vpar) = -0.5*Grad_parP(P + P0, CELL_YLOW);
ddt(Vpar) = -0.5 * Grad_par_LtoC(P + P0);
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: use of undeclared identifier 'Grad_par_LtoC' [clang-diagnostic-error]

      ddt(Vpar) = -0.5 * Grad_par_LtoC(P + P0);
                         ^

@@ -211,17 +214,19 @@ int main(int argc, char** argv) {
int nx, ny;

double** Rxy = readMatrix(dataFile, "Rxy", nx, ny);
if (!Rxy)
if (!Rxy) {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: implicit conversion 'double **' -> bool [readability-implicit-bool-conversion]

Suggested change
if (!Rxy) {
if (Rxy == nullptr) {

double** Zxy = readMatrix(dataFile, "Zxy", nx, ny);
if (!Zxy)
if (!Zxy) {
Copy link
Contributor

Choose a reason for hiding this comment

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

warning: implicit conversion 'double **' -> bool [readability-implicit-bool-conversion]

Suggested change
if (!Zxy) {
if (Zxy == nullptr) {

@ZedThree ZedThree merged commit 13e53f0 into next Mar 22, 2023
@ZedThree ZedThree deleted the next-format branch March 22, 2023 17:37
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.

None yet

2 participants