Skip to content

Conversation

@yurekami
Copy link
Contributor

Summary

Add clang-format configuration for consistent C++/CUDA code formatting.

Configuration Highlights:

  • Base: Google style with project-specific adjustments
  • Indentation: 4 spaces (matches existing code)
  • Line limit: 120 characters
  • Braces: Attached (same line as control statement)
  • Standard: C++17
  • Includes: Preserve existing order (no auto-sorting)
  • CUTLASS: Support for CUTLASS pragma macros

Also Includes:

  • Update .gitignore to specifically ignore .clangd and .clang-tidy instead of all .clang* files

Usage

# Format a single file
clang-format -i csrc/file.hpp

# Format all C++/CUDA files
find csrc -name "*.hpp" -o -name "*.cpp" -o -name "*.cu" -o -name "*.cuh" | xargs clang-format -i

Integration

Works with pre-commit hooks (PR #252) to automatically format code on commit.

Test plan

  • Configuration is valid YAML
  • Style matches existing codebase
  • Verify formatting output on sample files

🤖 Generated with Claude Code

Add clang-format configuration that matches the existing code style:

- 4-space indentation
- 120 character line limit
- Attached braces (same line)
- Google style base with project-specific adjustments
- C++17 standard
- Preserve include order (no auto-sorting)
- Support for CUTLASS macros

Also update .gitignore to be more specific about clangd files,
allowing .clang-format to be tracked.

This works with the pre-commit hooks (PR deepseek-ai#252) to automatically
format C++/CUDA code on commit.

Usage:
  clang-format -i csrc/**/*.{hpp,cpp,cu,cuh}

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

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.

1 participant