Sponsored Content
Skip to content

chore: Format all cmake files without comments - #6294

Merged
bthomee merged 3 commits into
XRPLF:developfrom
mathbunnyru:cmake_format_no_comments
Jan 29, 2026
Merged

chore: Format all cmake files without comments#6294
bthomee merged 3 commits into
XRPLF:developfrom
mathbunnyru:cmake_format_no_comments

Conversation

@mathbunnyru

Copy link
Copy Markdown
Contributor

High Level Overview of Change

I found a way not to reformat comments, which causes ugly style in these files, so let's merge the code. This way all the actual code will be uniformly formatted.

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)

@mathbunnyru
mathbunnyru requested review from bthomee and Copilot and removed request for Copilot January 29, 2026 16:50
@mathbunnyru mathbunnyru added the Trivial Simple change with minimal effect, or already tested. Only needs one approval. label Jan 29, 2026
@codecov

codecov Bot commented Jan 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.9%. Comparing base (a0e0918) to head (26ef6a6).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #6294   +/-   ##
=======================================
  Coverage     79.9%   79.9%           
=======================================
  Files          839     839           
  Lines        65528   65528           
  Branches      7272    7272           
=======================================
  Hits         52325   52325           
  Misses       13203   13203           

see 2 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.

Comment thread cmake/XrplCore.cmake Outdated
Comment on lines +13 to +21
target_protobuf_sources(
xrpl.libpb
xrpl/proto
LANGUAGE
cpp
IMPORT_DIRS
include/xrpl/proto
PROTOS
include/xrpl/proto/xrpl.proto)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Here and below: This is not as nice as it was before, and much harder to follow since the connection between the keyword (e.g. LANGUAGE) and value (e.g. cpp) is lost.

Is there any way to keep the existing behavior? Curiously with the target_link_libraries lines later, the alignments seem to work well for INTERFACE).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Was able to use custom command, seems to look better and uniform now

Comment thread cmake/XrplCore.cmake
Copilot AI review requested due to automatic review settings January 29, 2026 17:33
@mathbunnyru
mathbunnyru requested a review from bthomee January 29, 2026 17:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 reformats all CMake files that were previously excluded from cmake-format, applying consistent formatting with comment markup disabled to avoid disrupting comment styles.

Changes:

  • Updated .cmake-format.yaml to disable comment markup (enable_markup: false) and add custom command configuration for target_protobuf_sources
  • Removed exclusions from .pre-commit-config.yaml to enable cmake-format on previously excluded CMake files
  • Reformatted 9 CMake files with consistent style (spacing, indentation, line breaks)

Reviewed changes

Copilot reviewed 9 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.cmake-format.yaml Added custom command definition for target_protobuf_sources and disabled comment markup to preserve existing comment formatting
.pre-commit-config.yaml Removed exclusions for CMake files to enable automatic formatting
tests/conan/CMakeLists.txt Collapsed multi-line project() call to single line
cmake/target_protobuf_sources.cmake Applied consistent formatting to function definition and command calls
cmake/target_link_modules.cmake Applied consistent formatting with space after function/control flow keywords
cmake/isolate_headers.cmake Applied consistent formatting to function definition
cmake/add_module.cmake Consolidated multi-line function calls and applied consistent indentation
cmake/XrplInstall.cmake Reformatted install() commands and control flow statements with consistent style
cmake/XrplDocs.cmake Applied consistent formatting to functions and commands
cmake/XrplCore.cmake Reformatted target definitions and library linking calls
cmake/CodeCoverage.cmake Applied consistent formatting throughout with updated control flow spacing

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

@legleux

legleux commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

Can we space the parentheses consistently with everything else (specifically if()'s and function()'s noticed here)?
Or maybe as a follow up to hit all files?

@mathbunnyru

Copy link
Copy Markdown
Contributor Author

Can we space the parentheses consistently with everything else (specifically if()'s and function()'s noticed here)? Or maybe as a follow up to hit all files?

I'm not sure that's possible, will take a look as a follow-up

@mathbunnyru mathbunnyru added the Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. label Jan 29, 2026
@bthomee
bthomee enabled auto-merge (squash) January 29, 2026 18:01
@bthomee
bthomee merged commit fe9c8d5 into XRPLF:develop Jan 29, 2026
1 check passed
@mvadari mvadari added this to the 3.2.0 milestone May 20, 2026
beartec-jpg pushed a commit to beartec-jpg/FalconLedger that referenced this pull request Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready to merge *PR author* thinks it's ready to merge. Has passed code review. Perf sign-off may still be required. Trivial Simple change with minimal effect, or already tested. Only needs one approval.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants