Skip to content

Conversation

@mathbunnyru
Copy link
Contributor

@mathbunnyru mathbunnyru commented Jan 26, 2026

High Level Overview of Change

I add cmake-format pre-commit hook.
The style file is exactly like in Clio (so I would probably argue not to change it).
For now, I've added files where applying cmake-format doesn't look too bad, and added other files as exceptions - manually adjusting these files is a bit time-consuming, so I would probably do it separately, but we can benefit from cmake-format for most files already.

Context of Change

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (non-breaking change that only restructures code)
  • Performance (increase or change in throughput and/or latency)
  • Tests (you added tests for code that already exists, or your new feature included in this PR)
  • Documentation update
  • Chore (no impact to binary, e.g. .gitignore, formatting, dropping support for older tooling)
  • Release

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

@codecov
Copy link

codecov bot commented Jan 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.4%. Comparing base (bb529d0) to head (3e5d3dc).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           develop   #6279     +/-   ##
=========================================
- Coverage     79.4%   79.4%   -0.0%     
=========================================
  Files          839     839             
  Lines        71625   71625             
  Branches      8241    8236      -5     
=========================================
- Hits         56861   56855      -6     
- Misses       14764   14770      +6     

see 4 files with indirect coverage changes

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

CMakeLists.txt Outdated
endif ()

###
#
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this section "separator" character should just be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree, removed

Comment on lines 6 to 13
foo:
flags:
- BAR
- BAZ
kwargs:
HEADERS: "*"
SOURCES: "*"
DEPENDS: "*"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an actual sub-command that can be provided, and if so what does it do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it was an example from somewhere, and command foo doesn't make sense, removed it

disable: false
_help_line_width:
- How wide to allow formatted cmake files
line_width: 120
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although the line width adopted throughout the code somewhat varies from file to file and from moment to moment, it generally seems to be 80 characters. I'd suggest to therefore set this value to 80. Also in .clang-format there is ColumnLimit: 80.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines 129 to 130
- What character to use for bulleted lists
bullet_char: "*"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW: The cspell changes * to - in READMEs. Perhaps we should make this consistent and change to - too?

(I prefer *, but I like consistency even more.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's prettier, not cspell.
I agree, consistency is nice, changed here

Comment on lines 58 to 71
INTERFACE -bigobj # Increase object file max size
-fp:precise # Floating point behavior
-Gd # __cdecl calling convention
-Gm- # Minimal rebuild: disabled
-Gy- # Function level linking: disabled
-MP # Multiprocessor compilation
-openmp- # pragma omp: disabled
-errorReport:none # No error reporting to Internet
-nologo # Suppress login banner
-wd4018 # Disable signed/unsigned comparison warnings
-wd4244 # Disable float to int possible loss of data warnings
-wd4267 # Disable size_t to T possible loss of data warnings
-wd4800 # Disable C4800(int to bool performance)
-wd4503 # Decorated name length exceeded, name was truncated
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I quite like having the comments nicely aligned vertically. Is there an option in the .cmake-format to keep it how it was?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't found such an option.
But I was able to add comments above flags, I think it's readable enough and looks nice, wdyt?

Co-authored-by: Bart <bthomee@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 27, 2026 11:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a cmake-format pre-commit hook to automatically format CMake files according to a consistent style guide. The configuration matches the style used in Clio. The PR applies the formatting to most CMake files in the repository, with some files explicitly excluded as exceptions to be handled in a future PR.

Changes:

  • Added cmake-format pre-commit hook with configuration matching Clio's style
  • Reformatted multiple CMake files with consistent spacing, indentation, and line wrapping
  • Added cmake-format configuration terms to cspell dictionary

Reviewed changes

Copilot reviewed 17 out of 20 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
.pre-commit-config.yaml Adds cmake-format hook with excluded files list
.cmake-format.yaml Comprehensive cmake-format configuration with 120-char line width
.config/cspell.config.yaml Adds legitimate terms from cmake-format config (hwrap, kwarg, kwargs, pargs)
src/tests/libxrpl/CMakeLists.txt Reformats if/endif spacing
cmake/deps/Boost.cmake Reformats find_package, target_link_libraries, and if/endif blocks
cmake/create_symbolic_link.cmake Reformats function and if/endif spacing, condenses multi-line comment
cmake/XrplVersion.cmake Reformats foreach and if/endif spacing
cmake/XrplValidatorKeys.cmake Reformats option, function calls, and FetchContent_Declare
cmake/XrplSettings.cmake Reformats multiple option, if/endif, and set commands with improved comment wrapping
cmake/XrplSanity.cmake Reformats set, if/endif, and message calls with improved multi-line message formatting
cmake/XrplSanitizers.cmake Reformats extensive if/endif blocks, foreach loops, and message calls
cmake/XrplInterface.cmake Reformats target configuration commands and if/endif blocks
cmake/XrplCov.cmake Reformats if/endif and function calls with improved argument layout
cmake/XrplConfig.cmake Reformats include, set, find_dependency, and if/endif blocks
cmake/XrplCompiler.cmake Reformats extensive target_compile_options, target_link_libraries, and if/endif blocks
cmake/XrplAddTest.cmake Reformats function definition and file globbing
cmake/CompilationEnv.cmake Reformats multi-line comments and if/endif blocks
cmake/Ccache.cmake Reformats if/endif blocks and multi-line comments
cmake/CMakeFuncs.cmake Reformats macro/function definitions and execute_process calls
CMakeLists.txt Reformats if/endif blocks, include statements, and target_link_libraries calls

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mathbunnyru mathbunnyru requested a review from bthomee January 27, 2026 12:34
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