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

DOC: fixing "unbalanced grouping commands" warnings #5262

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

albert-github
Copy link
Contributor

Brute force approach to fix the "unbalanced grouping commands" warnings by explicitly placing the ALIASES ITKStartGrouping and ITKEndGrouping in the code where unbalanced grouping commands" warnings an attempt was made to insert the commands @{ and @} and afterwards solving the warnings that were already present in respect to the "unbalanced grouping commands" warnings and also solving the warnings that appeared due to these changes.

The usage of the script has been abandoned as this implicitly added the commands based on the layout and this is is hard to enforce and it is also hard to get the script without errors (would nearly require a compiler).

This is related to issue #3654

PR Checklist

  • No API changes were made (or the changes have been approved)
  • Updated API documentation (or API not changed)

@github-actions github-actions bot added the type:Documentation Documentation improvement or change label Mar 2, 2025
@albert-github
Copy link
Contributor Author

I'm looking into the commit / compilation problems.

@albert-github
Copy link
Contributor Author

@dzenanz

I fixed the errors warnings as mentioned in the ghostflow-check-master and pre-commit in 6e8c875 but I again get a red status why (especially the ghostflow-check-master?

@dzenanz
Copy link
Member

dzenanz commented Mar 2, 2025

You get the full list of messages if you click on the link. The first part is:

Errors:

commit 8b19ffd adds bad whitespace:

Modules/Core/Common/include/itkPlatformMultiThreader.h:185: new blank line at EOF.
Modules/Core/Mesh/include/itkSphereMeshSource.h:107: new blank line at EOF.
Modules/Core/Transform/include/itkTransformBase.h:213: new blank line at EOF.
Modules/Filtering/BiasCorrection/include/itkCacheableScalarFunction.h:156: new blank line at EOF.
Modules/Filtering/BiasCorrection/include/itkCompositeValleyFunction.h:188: new blank line at EOF.
Modules/Filtering/FastMarching/include/itkFastMarchingStoppingCriterionBase.h:103: new blank line at EOF.
Modules/IO/TransformMatlab/include/itkMatlabTransformIO.h:82: new blank line at EOF.

commit 8b19ffd adds Examples/IO/XML/itkParticleSwarmOptimizerSAXReader.cxx with executable permissions, but the file does not look executable.

commit 8b19ffd adds Examples/IO/XML/itkParticleSwarmOptimizerSAXWriter.cxx with executable permissions, but the file does not look executable.

commit 8b19ffd adds Examples/RegistrationITKv4/DeformableRegistration4.cxx with executable permissions, but the file does not look executable.

commit 8b19ffd adds Examples/RegistrationITKv4/DeformableRegistration6.cxx with executable permissions, but the file does not look executable.

@dzenanz
Copy link
Member

dzenanz commented Mar 2, 2025

For pre-commit:

[INFO] This may take a few minutes...
check for added large files..............................................Passed
check python ast.........................................................Passed
check for case conflicts.................................................Passed
check illegal windows names..........................(no files to check)Skipped
check json...............................................................Passed
check for merge conflicts................................................Passed
check toml...............................................................Passed
check vcs permalinks.....................................................Passed
check xml................................................................Passed
check yaml...............................................................Passed
check that scripts with shebangs are executable..........................Passed
debug statements (python)................................................Passed
detect destroyed symlinks................................................Passed
detect private key.......................................................Passed
fix end of files.........................................................Passed
forbid new submodules................................(no files to check)Skipped
forbid submodules....................................(no files to check)Skipped
mixed line ending........................................................Passed
python tests naming..................................(no files to check)Skipped
don't commit to branch...................................................Passed
trim trailing whitespace.................................................Passed
clang-format.............................................................Failed
- hook id: clang-format
- files were modified by this hook
pre-commit hook(s) made changes.
If you are seeing this message in CI, reproduce locally with: `pre-commit run --all-files`.
To run `pre-commit` as part of git workflow, use `pre-commit install`.
All changes made by hooks:
diff --git a/Examples/IO/XML/itkParticleSwarmOptimizerSAXReader.cxx b/Examples/IO/XML/itkParticleSwarmOptimizerSAXReader.cxx
index 72b7ca5..95f402a 100644
--- a/Examples/IO/XML/itkParticleSwarmOptimizerSAXReader.cxx
+++ b/Examples/IO/XML/itkParticleSwarmOptimizerSAXReader.cxx
@@ -57,7 +57,7 @@ ParticleSwarmOptimizerSAXReader::StartElement(const char *  name,
            this->ContextIs("/optimizer"))
   {
     std::vector<double> * bound = nullptr;
-/**@ITKEndGrouping*/
+    /**@ITKEndGrouping*/
     const char * id = this->GetAttribute(atts, "id");
     if (id == nullptr)
     {
@@ -108,7 +108,7 @@ ParticleSwarmOptimizerSAXReader::EndElement(const char * name)
       bounds.push_back(value);
     }
     this->m_OutputObject->SetParameterBounds(bounds);
-/**@ITKEndGrouping*/
+    /**@ITKEndGrouping*/
     this->m_OutputObject->SetParametersConvergenceTolerance(
       this->m_ParametersConvergenceTolerance);
   }
@@ -178,7 +178,7 @@ ParticleSwarmOptimizerSAXReader::ReadFile()
       e.SetDescription(message.c_str());
       throw e;
     }
-/**@ITKEndGrouping*/
+    /**@ITKEndGrouping*/
     if (this->m_OutputObject == nullptr)
     {
       itkExceptionMacro("Object to be read is null!\n");

@albert-github
Copy link
Contributor Author

The problem in the ghostflow looks like a false positive as this has been fixed in 6e8c875 but the ghostflow refers to 8b19ffd

So this looks to me a small problem in ghostflow, but I might be mistaken.

image

@dzenanz
Copy link
Member

dzenanz commented Mar 2, 2025 via email

@albert-github
Copy link
Contributor Author

If you squash commits and force push, that might fix it.

I'll keep it in mind.
I never did a squash nor force push so I'm a bit reluctant to do it. I'll wait till I fixed some more problems that I see in other parts.
Is there anywhere a good and understandable guide how to squash and force push ? (git is nearly a complete black box to me)

Written on cellphone, excuse my brevity.

No problem.

@dzenanz
Copy link
Member

dzenanz commented Mar 2, 2025

Possible article to read, and/or this SO answer.

@albert-github
Copy link
Contributor Author

I added a new set of changes.

  • regarding the ghostflow problem I didn't look into it yet besides that I looked for the repository whether or not I could find any reference but in vain. I think it is a bit strange to satisfy ghostflow by means of squashing the commits as I think the problem might be in the ghosflow script / configuratio (but I might be mistaken).
    I looked on the internet and found for kwrobot-v1 (https://github.com/apps/kwrobot-v1):

    Automatically checks pull requests for developers working with Kitware.

    This GitHub App requires manual configuration by its maintainers for each installation and is not managed via any web page. It is public only to facilitate separation of ownership and installation in multiple organizations.

    So it looks a bit outside my scope.

@dzenanz dzenanz force-pushed the feature/issue_3654 branch from 222250b to 5f0b209 Compare March 3, 2025 14:28
@dzenanz
Copy link
Member

dzenanz commented Mar 3, 2025

I just squashed the commits, and applied clang-format to all files. Let's see what the CI says now.

@dzenanz dzenanz force-pushed the feature/issue_3654 branch from 5f0b209 to 630350e Compare March 3, 2025 14:43
@albert-github
Copy link
Contributor Author

@dzenanz
Thank you very much.

  • Looks much better I see that you did a second squash Looks much better.
  • I'll have a look at the other problems, looks like the macOS gave a nice error message (part of the file missing...).

@dzenanz
Copy link
Member

dzenanz commented Mar 3, 2025

There are 38 compile errors, e.g.: Modules/Core/Common/include/itkPlatformMultiThreader.h:28: error: unterminated #ifndef

Indeed, the last several lines were removed from this file.

@albert-github
Copy link
Contributor Author

@dzenanz
I fixed (at least I hope so) the compilation errors, but apparently made a small mistake (the empty line ..., have to pay more attention to those things).

  • Can you remove the line and squash again (sorry for the inconvenience).

Brute force approach to fix the "unbalanced grouping commands" warnings by explicitly placing the `ALIASES` `ITKStartGrouping` and `ITKEndGrouping` in the code where unbalanced grouping commands" warnings an attempt was made to insert the commands `@{` and `@}` and afterwards solving the warnings that were already present in respect to the "unbalanced grouping commands" warnings and also solving the warnings that appeared due to these changes.

The usage of the script has been abandoned as this implicitly added the commands based on the layout and this is is hard to enforce and it is also hard to get the script without errors (would nearly require a compiler).

This is related to issue InsightSoftwareConsortium#3654.
@dzenanz dzenanz force-pushed the feature/issue_3654 branch from 5457138 to 2d884aa Compare March 3, 2025 15:41
@dzenanz
Copy link
Member

dzenanz commented Mar 3, 2025

No problem. Thank you for contributing!

@dzenanz
Copy link
Member

dzenanz commented Mar 3, 2025

Looking at ITK CDash, search for "Build Names" containing PR5262. Sorting by "Start Time" column you can get the latest build, which still has plenty of build errors.

@albert-github
Copy link
Contributor Author

@dzenanz
Very interesting references, tough I only see "condensed" log files and, to be honest, for a first overview this looks like OK but sometimes it is better to have the complete overview i.e. the complete log file.
How often are these tables refreshed, especially the one for this Pull request?

It is strange that a number of files missed some last lines (but with that many files it, unfortunately, can happen). I'll try to fix them (maybe one by one but hopefully faster.

@dzenanz
Copy link
Member

dzenanz commented Mar 3, 2025

The CDash Experimental table is usually refreshed once the CI build workers finish, and report failures both to GitHub (the list of checks in the PR) and CDash. Without compile errors, a few hours. With compile errors, sooner 😄

@albert-github
Copy link
Contributor Author

@dzenanz

Thanks. I'll check it out.
I'm amazed that doxygen didn't emit warnings like More #endif's than #if's found. which should be given by the doxygen preprocessor. Something for me to investigate.
In the mean time I already found a few more files with missing end parts.

Copy link

kwrobot-v1 bot commented Mar 3, 2025

Errors:

  • Failed to reserve ref 7634fa8 for the merge request: invalid git ref: 'no such commit'.
  • Failed to run the checks: mr utilities error: failed to list commits of 7634fa81b792ffd4da04da8b7070161f90d7427f for https://github.com/InsightSoftwareConsortium/ITK/pull/5262: fatal: bad object 7634fa81b792ffd4da04da8b7070161f90d7427f .

@albert-github
Copy link
Contributor Author

albert-github commented Mar 3, 2025

@dzenanz

Any idea about the error from the kwrobot at #5262 (comment)

Edit looks like the ghostflow wants now to revert a change that it beforehand would like to have...

Edit 2 Looks partly like a self healing system. but now the precommit throws a similar message ...

@dzenanz
Copy link
Member

dzenanz commented Mar 3, 2025

@bradking this looks like a bug in kwrobot-v1?

- consistency
- missing code
- pre-commit warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:Documentation Documentation improvement or change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants