Skip to content

Conversation

@Lomholy
Copy link
Collaborator

@Lomholy Lomholy commented Feb 9, 2026

Free-form text area

Please describe what your PR is adding in terms of features or bugfixes:

This PR proposes to use an established auto formatter for C code, and then applying said formatter in components.

This is of course only possible by treating each different section (TRACE SHARE etc.) as its own little C code.

I propose this in order to improve the readability of the larger components after multiple people with different editors have changed indenting and therefore arrive at inconsistent indenting.

I do not have a strong opinion of which formatter to use, nor which style to set it to. What is important to me, is to make it easy to have a properly indented code to work on.

For this PR I initially used the formatter bundled with the Visual Studio code extension C/C++ from microsoft which is the clang-format tool.
A brief google search indicates that Astyle is another option, if we want something that is not heavily supported by apple or microsoft.

Examples of the microsoft formatter applied to code is in this pull request the Monochromator_bent.comp, Monochromator_bent_complex.comp and Union_mesh.comp.


  • My contribution contains something else

    • Explanation is added in free form text above or below the checklist

@willend
Copy link
Contributor

willend commented Feb 10, 2026

@Lomholy could you please remove "irrelevant"/non-related parts of the PR checkboxes?

In the current form I think it very unclear what the point of your PR is?

(As a sidenote I am inclined to support less rather than more dependency on MS tech these days...)

@Lomholy
Copy link
Collaborator Author

Lomholy commented Feb 10, 2026

@willend I updated the PR and added some information.

I think it may be important to note that i half intend this PR as a short discussion on using a formatter or not.
I believe it is a tool that can help us write more transparent code, and the choice of which and how could be important for a number of reasons that are important to discuss.

@willend
Copy link
Contributor

willend commented Feb 10, 2026

Hi again @Lomholy - thanks for improving the PR info.

Maybe open a separate discussion item? (IMHO better for a longer exchange than a PR is)

https://github.com/mccode-dev/McCode/discussions.

@Lomholy
Copy link
Collaborator Author

Lomholy commented Feb 10, 2026

@willend Separate discussion has now been opened :D

@willend
Copy link
Contributor

willend commented Feb 11, 2026

@Lomholy thanks. Vacation this week, will participate in discussion after.

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