Skip to content

Conversation

Copy link

Copilot AI commented Oct 16, 2025

This PR implements proper code formatting across the entire codebase using clang-format, addressing the need for consistent code style and maintainability.

Changes

Code Formatting

  • Applied clang-format to 76 C/C++ source files (.c, .cpp, .h, .hpp) in the workspace
  • Excluded _unmaintained directory to preserve legacy code as-is
  • All changes are purely cosmetic (whitespace, indentation, spacing) with no functional modifications

Configuration

Added .clang-format configuration file with style settings that balance consistency with existing code patterns:

  • Indentation: Tabs (4 spaces wide)
  • Brace Style: Linux style (opening brace on next line for functions)
  • Line Length: 120 characters maximum
  • Pointer Alignment: Right-aligned (char *ptr not char* ptr)
  • Spacing: Consistent spacing around operators, keywords, and function calls

Documentation

  • Created CONTRIBUTING.md with comprehensive guidelines for contributors including:
    • How to install and use clang-format
    • Commands for formatting code before submitting PRs
    • Instructions for verifying formatting
    • Editor integration tips
  • Updated README.md to reference the new contributing guide

Benefits

  • Consistency: Uniform code style across the entire codebase
  • Maintainability: Easier to read, review, and maintain code
  • Automation: Contributors can automatically format their code with a single command
  • Quality: Reduces formatting-related discussions in code reviews
  • Standards: Establishes a clear coding standard for future contributions

Verification

All files have been verified to:

  • Pass clang-format validation with zero errors
  • Maintain syntactic correctness
  • Produce reproducible formatting

Contributors can now format their code with:

find workspace -type f \( -name "*.c" -o -name "*.cpp" -o -name "*.h" -o -name "*.hpp" \) | grep -v "_unmaintained" | xargs clang-format -i

Closes #[issue_number] (if applicable)

Original prompt

Proper code formatting. Use clang-format.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copilot AI and others added 3 commits October 16, 2025 13:17
Co-authored-by: frysee <1319672+frysee@users.noreply.github.com>
Co-authored-by: frysee <1319672+frysee@users.noreply.github.com>
Co-authored-by: frysee <1319672+frysee@users.noreply.github.com>
Copilot AI changed the title [WIP] Format code using clang-format Apply clang-format to all C/C++ source files for consistent code formatting Oct 16, 2025
Copilot AI requested a review from frysee October 16, 2025 13:22
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