Establishes a clean formatting baseline on GTK3V2MAIN and prevents future drift.
37 of 362 tracked .c/.h files (excluding unittest dirs) currently don't conform to app/lib/astylerc, verified 2026-07-11. 2 of those 37 are vendored third-party code (app/tools/halibut/charset/iso2022.c, app/wlib/gtk3lib/wrapbox/eggwrapbox.c) and are excluded from scope -- reformatting vendored upstream code creates diff-drift against the real upstream for no benefit. So 35 files get reformatted.
Single formatting-only commit, zero logic changes, followed by a new CI job that runs astyle in dry-run mode and fails if any tracked file would be reformatted.
Part of a broader GTK3V2MAIN quality-improvement pass (see internal plan) -- this branch goes first since it establishes a clean baseline that the rest of the work (warning fixes) builds on without double-touching the same lines.
Scope: GTK3V2MAIN only (this branch is expected to become the project default before end of year; GTK2/default gets an equivalent backlog item for later).
Anonymous
I believe astyle is generating different result for Windows verus Linux
Consider cjoin.c line 551 indentation
astyle was applied in change 6421 which exdented line 551
and again in change 6694 which indented line 551
I think change 6421 was applied on Wndows while change 6694 was applied on Linux
Ken: can you confirm 6421 was run on Windows and astyle on change 6694 wil exdent line 551
Another thing to check is the version that was executed.
Claude investigation:
Root cause: astyle version mismatch, not a Windows-vs-Linux platform bug.
I pulled the actual historical revisions and reproduced this in a fresh container running astyle 3.1 (CI's exact pinned version):
indent. So his tool disagreed with 3.1 at the time, not because of OS, but because it wasn't the same astyle version/build.
So the reviewer's fear — "will 6694's astyle re-exdent line 551 again" — doesn't hold: 3.1 does not want to touch it further; it's already a stable fixed point. This is the same category of issue already documented from Phase 0 (local
astyle 3.6.13 vs CI's apt-installed 3.1 disagreeing) — the fix isn't "make every astyle version agree," it's "CI pins one version and gates on it," which is exactly what's now in place and already passed 17/17 (including
astyle-check) on the bug-638 PR.
Recommend standardizing on AStyle 3.1 (the version CI now pins) for any local reformatting.
macOS's Homebrew astyle is 3.6.16 (not 3.1), and it disagrees with the Linux-pinned 3.1 on 20 files (cjoin.c included). This actually reinforces the diagnosis: different astyle versions really do disagree, which is why "pin one canonical version and treat it as authoritative" (already in place) is the right fix, not something you could ever make agree across every platform's default package manager.
Confirmed pattern: Windows/MSYS2's astyle is 3.6.13 (the same version noted in the earlier local-dev-sandbox lesson), and it also disagrees with Linux's 3.1. So both macOS (3.6.16) and Windows (3.6.13) track a much newer astyle release than Ubuntu 24.04's apt package (3.1) — this isn't really an OS quirk, it's that different package repos simply carry different astyle release lines.
I built astyle version 3.6.12 on my linux box and use it. I wasn't aware we had to use a specific version of it. Personally, I'm for keeping more up to date styling despite what's available as a package. If windows, mac, linux have a 3.6.x, we ought to use it to be consistent.
I also came up with the .editorconfig to hopefully match what it puts out, so there's less style changes. I also use nvim, and noticed way too late that style changes were being automatically performed which is why I came up with the .editorconfig.
A brief look at a diff shows a mixture of tabs and spaces still used for styling and the "one space off" seen from 3.1.
I discovered this issue in a previous life where we were using clang format (doxygen has similar issues) where we needed to use the correct version across platforms and have an official published version. Just one of many software engineering tasks in a multi-platform, multi-compiler, multi-person project.
Updated the branch.
This is stronger than just "same version number" — astyle's --dry-run internally reformats each file in memory and compares it byte-for-byte against what's on disk, only printing Formatted <file> when they differ. Each job checks out the exact same commit (the 38 reformatted files), and all three independently-built 3.6.13 binaries — compiled by three different compilers (GCC/Ubuntu, Apple Clang/macOS, MinGW-GCC/Windows) — report zero files need further changes, across the entire app/bin/app/wlib tree, not just the 38 we touched.</file>
So: same version pinned everywhere, and confirmed byte-identical formatting output across all three platforms.
Diff:
So, no diffs then from running astyle. Branch and ticket can be closed.
Everyone should use 3.6.13 and wiki's (if any which address this) updated.
Ken
astyle runs made real, verifiable changes, and the bug-638 branch tip is genuinely different from SF's current GTK3V2MAIN content.
34 files are genuine astyle-driven .c/.h changes (ddrawprim.c, draw.c, dlayer.c, wpref.c, wlib.h, etc.) — real formatting deltas, confirmed by inspecting content.
So there are changes to be made. There are no diferences in platforms using the same 3.6.13 astyle.
OK to merge?
Allen
I believe the consensus for astyle changes is that their commit is just for style changes, not other changes. Specifically run astyle then commit. Style changes that happen to come in from editor preference when making other changes are ok.
I mention this because I checked your commit and saw other content changes that weren't just styling.
Strange, I all saw was whitespace changes and addition of some brackets -
all due to astyle run AFIK. Was the brackets the issue?
Allen
On Wed, Jul 15, 2026 at 1:09 PM strobelight str0belight@users.sourceforge.net wrote:
Related
Bugs:
#638I went to Commit [0f2c3e] Summary and scrolled down and saw cprint.c changed.
OH, I did not see that because my local diff did not show that line (see
https://github.com/adbyrne/XTrkCAD/pull/4/changes#diff-611160645b36fc922c3c7441f0c52402142752f146ac267c7b103c60bb88d669).
My diff only showed whitespace and brackets compared to the tip of
GTK3V2MAIN when I ran astyle. I did not do anything else unless it was
somehow a glitch between the original astyle based on 3.1 vs the later
change to astyle based on 3.6, I did do some other work. But still my
updated diff did not show it so maybe my local copy had been changed in
between.
Allen
On Thu, Jul 16, 2026 at 7:21 AM strobelight str0belight@users.sourceforge.net wrote:
Related
Bugs:
#638Commit: [0f2c3e]
perhaps a commit was made that you forgot about.
you can
hg outbefore running astyle to check.It appears that a 0 change astyle run is now reuired for updates.
If so, we need to update
https://sourceforge.net/p/xtrkcad-fork/wiki/BuildNotes/
Also, make it clear that astyle version 3.6.13 is required, with instructions on how to get it.
The current release of astyle is 3.6.17 which produces different results from 3.6.13.
(40 diffs in app/bin)
It's suprising that a minor change (..13->..17) would cause such grief
How closely do we have to track astyle?
Dave
Yes, minor changes shouldn't do that - but that is the problem with
external tools. So astyle 3.6.13 was proved to produce the exact same
output across the platforms. Why 3.6.13, because at the time I did the
tests that was the latest version on mac and windows GH images, therefore I
focused on that. I am working on doxygen fixes and will add a version of
tools section.
Allen
On Sat, Jul 18, 2026 at 12:19 PM Dave Bullis sillub@users.sourceforge.net
wrote:
Related
Bugs:
#638