Add .clang-format configuration#143
Conversation
killerdevildog
commented
Jul 20, 2025
- Addresses issue Add .clang-format #56 by adding clang-format configuration
- Based on LLVM style with customizations to preserve project aesthetics
- Enables AlignConsecutiveAssignments to maintain alignment preferences
- Sets PointerAlignment to Right for consistency with existing code
- Preserves include order and maintains 4-space indentation
- Disables column limit to avoid breaking long expressions
- Configuration tested to minimize changes to existing codebase
- Addresses issue xissburg#56 by adding clang-format configuration - Based on LLVM style with customizations to preserve project aesthetics - Enables AlignConsecutiveAssignments to maintain alignment preferences - Sets PointerAlignment to Right for consistency with existing code - Preserves include order and maintains 4-space indentation - Disables column limit to avoid breaking long expressions - Configuration tested to minimize changes to existing codebase
|
Thanks for the attempt at making this work. This still breaks the code structure in many locations. Perhaps it's not feasible to reproduce the code style in clang-format. It would have to be adapted into a new style. |
|
Thank you for reviewing this PR, @xissburg. I appreciate the feedback—it's helpful to know that the current config still introduces some unwanted changes to the code structure. My goal was to get as close as possible to the existing style while leveraging clang-format for consistency moving forward, but I understand if it's not quite there yet. To make this more actionable, could you point me to a few specific files or locations where the formatting breaks in undesirable ways? That would allow me to tweak the config further (e.g., adjusting rules around alignment, breaks, or other LLVM overrides) and test iterations without overhauling the entire codebase blindly. Alternatively, if adapting to a slightly new style via clang-format makes sense (perhaps starting from this base and refining it collaboratively), I'm open to that too—it could simplify maintenance long-term while preserving the project's core aesthetics. What are your thoughts? I'm happy to update the PR accordingly. |
|
I have pushed a few changes that comes closer to the original style. Though there are still issues I cant quite figure out. A couple of issues but it's getting close :) |