Skip to content

Conversation

@konard
Copy link
Member

@konard konard commented Sep 11, 2025

Summary

This PR addresses issue #127 by implementing consistent C++ code formatting using clang-format, similar to how Java projects use ./gradlew spotlessCheck and ./gradlew spotlessApply.

Changes Made

  • Added .clang-format configuration - Defines consistent style rules for all C++ code
  • Formatted all 29 C++ files - Applied consistent formatting to existing codebase using clang-format
  • Created formatting scripts:
    • ./format-check.sh - Equivalent to ./gradlew spotlessCheck for C++
    • ./format-apply.sh - Equivalent to ./gradlew spotlessApply for C++
  • Added GitHub Actions workflow - Automatically checks PR formatting and rejects if style violations found
  • Updated README.md - Added documentation for formatting commands and CI integration

Format Scripts Usage

Check formatting (similar to ./gradlew spotlessCheck):

./format-check.sh

Apply formatting (similar to ./gradlew spotlessApply):

./format-apply.sh

CI Integration

Pull requests now automatically check C++ code formatting. If formatting issues are found, the PR will fail until code is properly formatted, ensuring consistent code style across all contributions.

Test Plan

  • Applied formatting to all existing C++ files (29 files processed)
  • Verified format-check.sh passes on formatted code
  • Tested format-apply.sh script functionality
  • Added GitHub Actions workflow for automated checking
  • Updated documentation in README.md

🤖 Generated with Claude Code


Resolves #127

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #127
@konard konard self-assigned this Sep 11, 2025
konard and others added 2 commits September 11, 2025 11:31
- Add .clang-format configuration file with project style rules
- Format all 29 C++ source and header files using clang-format
- Create format-check.sh script (equivalent to ./gradlew spotlessCheck)
- Create format-apply.sh script (equivalent to ./gradlew spotlessApply)
- Add GitHub Actions workflow for automated PR style checking
- Update README.md with formatting documentation

The formatting rules ensure consistent code style across the C++ codebase,
similar to how Java projects use spotless for formatting.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Format all C++ code for one style and [optional]implement pr style check Format all C++ code for consistent style and implement PR style checking Sep 11, 2025
@konard konard marked this pull request as ready for review September 11, 2025 08:36
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.

Format all C++ code for one style and [optional]implement pr style check

2 participants