Skip to content

Conversation

davidlion
Copy link
Member

@davidlion davidlion commented Jul 7, 2025

Description

Recently, the linting CI is failing due to a new version of gersemi requiring code formatting changes (e.g. https://github.com/y-scope/ystdlib-cpp/actions/runs/16106150197/job/45441911050). This PR applies the change and also bumps the version in lint-requirements.txt to reflect the latest version.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

CI and gersemi passing.

Summary by CodeRabbit

  • Chores
    • Updated formatting in build configuration files for improved clarity.
    • Increased minimum required version of the gersemi package for linting.

@davidlion davidlion requested a review from a team as a code owner July 7, 2025 23:48
Copy link

coderabbitai bot commented Jul 7, 2025

Walkthrough

The updates include a syntactic adjustment to the target_sources command in a CMake helper script to better align with CMake's structure for header file sets, and an update to the minimum required version of the gersemi package in the linting requirements file. No changes were made to public APIs or logic.

Changes

File(s) Change Summary
cmake/ystdlib-helpers.cmake Refactored target_sources usage to use explicit nested FILE_SET/HEADERS block structure.
lint-requirements.txt Updated gersemi minimum version requirement from >=0.16.2 to >=0.20.0.

Sequence Diagram(s)

No sequence diagram is provided as the changes are limited to build configuration and dependency specification.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0ae886c and 7ec8020.

📒 Files selected for processing (2)
  • cmake/ystdlib-helpers.cmake (1 hunks)
  • lint-requirements.txt (1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: davidlion
PR: y-scope/ystdlib-cpp#65
File: cmake/ystdlib-helpers.cmake:105-113
Timestamp: 2025-06-16T16:02:19.821Z
Learning: In CMake, using target_sources() with PUBLIC and FILE_SET HEADERS on INTERFACE targets is valid and equivalent to using INTERFACE. FILE_SET HEADERS are treated as usage requirements, not compilation sources, so they don't cause errors on INTERFACE targets in modern CMake versions like 3.31.
Learnt from: davidlion
PR: y-scope/ystdlib-cpp#65
File: cmake/ystdlib-helpers.cmake:105-113
Timestamp: 2025-06-16T16:05:45.088Z
Learning: In CMake, using target_sources() with PUBLIC and FILE_SET HEADERS on INTERFACE targets is valid and equivalent to using INTERFACE. FILE_SET HEADERS are treated as usage requirements, not compilation sources, so they don't cause errors on INTERFACE targets in modern CMake versions like 3.31.
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#0
File: :0-0
Timestamp: 2025-03-06T20:42:41.772Z
Learning: In the y-scope/ystdlib-cpp project, the linting scope is limited to .h, .hpp, and .cpp files, and the header-only detection logic in CMake checks for .h, .hpp, and .inc extensions.
cmake/ystdlib-helpers.cmake (9)
Learnt from: davidlion
PR: y-scope/ystdlib-cpp#65
File: cmake/ystdlib-helpers.cmake:105-113
Timestamp: 2025-06-16T16:02:19.821Z
Learning: In CMake, using target_sources() with PUBLIC and FILE_SET HEADERS on INTERFACE targets is valid and equivalent to using INTERFACE. FILE_SET HEADERS are treated as usage requirements, not compilation sources, so they don't cause errors on INTERFACE targets in modern CMake versions like 3.31.
Learnt from: davidlion
PR: y-scope/ystdlib-cpp#65
File: cmake/ystdlib-helpers.cmake:105-113
Timestamp: 2025-06-16T16:05:45.088Z
Learning: In CMake, using target_sources() with PUBLIC and FILE_SET HEADERS on INTERFACE targets is valid and equivalent to using INTERFACE. FILE_SET HEADERS are treated as usage requirements, not compilation sources, so they don't cause errors on INTERFACE targets in modern CMake versions like 3.31.
Learnt from: anlowee
PR: y-scope/ystdlib-cpp#63
File: taskfiles/lint-cpp.yaml:75-83
Timestamp: 2025-05-26T15:34:11.199Z
Learning: In the ystdlib-cpp project taskfiles, prefer keeping command-line flags and their values together in single YAML list entries (e.g., "--config-file '{{.ROOT_DIR}}/.clang-tidy'") rather than separating them into individual entries, unless the values are too long. This improves readability and maintains consistency with the project's style.
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#0
File: :0-0
Timestamp: 2025-03-06T20:42:41.772Z
Learning: In the y-scope/ystdlib-cpp project, the linting scope is limited to .h, .hpp, and .cpp files, and the header-only detection logic in CMake checks for .h, .hpp, and .inc extensions.
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#0
File: :0-0
Timestamp: 2025-03-01T05:38:37.570Z
Learning: The README.md in the ystdlib-cpp repository consistently uses ATX style markdown headings (with # symbols) throughout the document.
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#0
File: :0-0
Timestamp: 2025-03-01T05:38:37.570Z
Learning: The README.md in the ystdlib-cpp repository consistently uses ATX style markdown headings (with # symbols) throughout the document.
Learnt from: PacificViking
PR: y-scope/ystdlib-cpp#65
File: CMakeLists.txt:87-88
Timestamp: 2025-06-06T15:01:53.987Z
Learning: The y-scope/ystdlib-cpp project uses lowercase `ystdlib_` prefix for project-specific CMake variables (e.g., `ystdlib_VERSION`, `ystdlib_BUILD_TESTING`, `ystdlib_INSTALL_CONFIG_DIR`) following the current naming convention standards.
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#0
File: :0-0
Timestamp: 2025-03-04T13:29:59.639Z
Learning: Yscope coding guidelines prefer not to split standard libraries when organizing include statements. Headers should be organized by component group with all standard library includes grouped together.
Learnt from: Bill-hbrhbr
PR: y-scope/ystdlib-cpp#0
File: :0-0
Timestamp: 2025-03-04T13:29:59.638Z
Learning: Yscope coding guidelines prefer not to split standard libraries when organizing include statements. Headers should be organized by component group with all standard library includes grouped together.
🔇 Additional comments (2)
lint-requirements.txt (1)

4-4: Unable to verify latest gersemi release—please check manually
We weren’t able to fetch the newest stable version of gersemi from PyPI (network/JSON decode error). To guard against future breaking changes, please:

• In lint-requirements.txt, replace
gersemi>=0.20.0
with either
gersemi==<tested_version>
(the exact version you’ve validated in CI)
or
gersemi>=0.20.0,<0.21.0

• Confirm that <tested_version> corresponds to the version your build currently uses and passes.

cmake/ystdlib-helpers.cmake (1)

109-114: Syntax tweak looks correct; ensure minimum CMake ≥ 3.23.

The separated
FILE_SET HEADERS BASE_DIRS … FILES …
syntax is valid from CMake 3.23 onward. If the project still claims support for older versions, update the top-level cmake_minimum_required accordingly or retain the previous flat form. Otherwise, the change is LGTM.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Member

@kirkrodrigues kirkrodrigues left a comment

Choose a reason for hiding this comment

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

For the PR title, how about:

fix(lint): Update to latest version of gersemi and apply corresponding format changes.

@davidlion davidlion changed the title fix(cmake): Apply formatting changes from latest gersemi version and update lint-requirement.txt. fix(lint): Update to latest version of gersemi and apply corresponding format changes. Jul 8, 2025
@davidlion davidlion merged commit 6c61594 into y-scope:main Jul 8, 2025
9 of 10 checks passed
@davidlion davidlion deleted the gersmi-update branch July 8, 2025 02:53
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