Skip to content

Conversation

@MinyazevR
Copy link
Contributor

This PR aims to add ClangFormat to PythonQt. During the discussion, it was decided that clang-format is a valid solution.
A version of clang-format-20 or higher is required, and a testing script (run-clang-format.sh) has been written for testing and/or running in CI.

It is worth noting that the PythonQt Generator has a style that differs from the main src directory. If this is a priority, you can put a separate .clang-format in the generator directory, which will override the parent one.

The following steps:

  1. Run run-clang-format.sh locally
  2. If you are satisfied with the formatting result, merge this PR (possibly changing some .clang-format parameters)
  3. Merge formatted code
  4. Add CI

@mrbean-bremen
Copy link
Contributor

It is worth noting that the PythonQt Generator has a style that differs from the main src directory

This has been discussed before, @usiems wrote:

The generator is composed of sources from different sources, with vastly different styles,

As far as I understand, there is a consensus that a common style would be ok.

@usiems
Copy link
Contributor

usiems commented Jun 27, 2025

The code in generator/simplecpp should be excluded from the reformatting, as this is code from an external source which might be updated again in the future.

@mrbean-bremen
Copy link
Contributor

I had a look at the formatted code, and it mostly looks good to me (with a couple of things that I probably would like to change in the config).
Before continuing with this PR, I would like to wait for the other large PR from the Slicer folks (which may take a while) to avoid a lot of conflicts.

@jcfr
Copy link
Contributor

jcfr commented Aug 25, 2025

for the other large PR from the Slicer folks

🙏 I am now working on this and you should expect a series of targeted pull requests 🚀

@mrbean-bremen
Copy link
Contributor

@MinyazevR - I see that you are closing all your PRs - are you giving up on this, or is there a technical reason?
I still would like to have the clang-format config - I'm just not sure about state of the backmerge done by @jcfr.

@jcfr
Copy link
Contributor

jcfr commented Nov 14, 2025

@mrbean-bremen In term of backport, I have done everything i wanted to. Thanks for checking in. The remaining parts will be relates to CMake support and can definitely be done afterwards.

Regarding clang, I suggest you exclude the generated_cpp folder.

@MinyazevR
Copy link
Contributor Author

@mrbean-bremen
Please forgive me. I deleted the repository, forgetting that I had active pull requests in it. I reopened this PR: #326

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.

4 participants