Skip to content

fix: correct SPDX comment syntax in DDEShellDockConfig.cmake.in#1575

Merged
wjyrich merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-cmakeDeb
Apr 29, 2026
Merged

fix: correct SPDX comment syntax in DDEShellDockConfig.cmake.in#1575
wjyrich merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-cmakeDeb

Conversation

@wjyrich
Copy link
Copy Markdown
Contributor

@wjyrich wjyrich commented Apr 29, 2026

Changed the SPDX license header from C++ style // comments to CMake # style comments to match the file's CMake language syntax, ensuring proper SPDX license handling.

Log: Fixed SPDX license comment syntax in CMake configuration file

Influence:

  1. Verify SPDX license header parsing tools recognize the corrected syntax
  2. Confirm CMake build system processes the file without warnings
  3. Ensure no functional impact on the dock panel configuration

fix: 修正 DDEShellDockConfig.cmake.in 中 SPDX 注释语法

将 SPDX 许可证头从 C++ 风格的 // 注释改为 CMake 风格的 # 注释,以匹 配文件的 CMake 语言语法,确保 SPDX 许可证的正确处理。

Log: 修复 CMake 配置文件中的 SPDX 许可证注释语法

Influence:

  1. 验证 SPDX 许可证头解析工具能识别修正后的语法
  2. 确认 CMake 构建系统处理该文件时无警告
  3. 确保对 Dock 面板配置无功能影响

Summary by Sourcery

Enhancements:

  • Align the SPDX license header in DDEShellDockConfig.cmake.in with CMake # comment syntax for proper tooling recognition.

Changed the SPDX license header from C++ style `//` comments to CMake
`#` style comments to match the file's CMake language syntax, ensuring
proper SPDX license handling.

Log: Fixed SPDX license comment syntax in CMake configuration file

Influence:
1. Verify SPDX license header parsing tools recognize the corrected
syntax
2. Confirm CMake build system processes the file without warnings
3. Ensure no functional impact on the dock panel configuration

fix: 修正 DDEShellDockConfig.cmake.in 中 SPDX 注释语法

将 SPDX 许可证头从 C++ 风格的 `//` 注释改为 CMake 风格的 `#` 注释,以匹
配文件的 CMake 语言语法,确保 SPDX 许可证的正确处理。

Log: 修复 CMake 配置文件中的 SPDX 许可证注释语法

Influence:
1. 验证 SPDX 许可证头解析工具能识别修正后的语法
2. 确认 CMake 构建系统处理该文件时无警告
3. 确保对 Dock 面板配置无功能影响
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 29, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR updates the SPDX license header in DDEShellDockConfig.cmake.in to use CMake-style # comments instead of C++-style // comments so that SPDX tools and CMake treat the header correctly, without altering any functional build or dock configuration logic.

File-Level Changes

Change Details Files
Normalize SPDX license header syntax in the CMake config template to use # comments.
  • Replaced leading // SPDX license comment lines with #-prefixed lines consistent with CMake syntax.
  • Kept the SPDX identifier and license text unchanged to maintain licensing intent and compatibility with SPDX parsers.
  • Ensured the rest of the CMake template content remains untouched so there is no behavioral impact on the dock panel configuration or build output.
panels/dock/frame/DDEShellDockConfig.cmake.in

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, BLumia, wjyrich

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot
Copy link
Copy Markdown

deepin pr auto review

这段代码是对 CMake 配置文件 DDEShellDockConfig.cmake.in 的修改。经过审查,以下是针对语法逻辑、代码质量、代码性能和代码安全的详细审查意见及改进建议:

1. 语法逻辑

  • 审查意见:修改将文件开头的注释符号从 C++ 风格(//)改为了 Shell/Python 风格(#)。
  • 评价非常正确且必要的修改
  • 原因:CMake 脚本(.cmake.in 文件)使用 # 作为注释符号,而不是 C++ 的 //。使用 // 会导致 CMake 将其视为命令而非注释,从而在配置阶段报错(例如 // 被当作可能的命令调用)。修改为 # 符合 CMake 语法规范。

2. 代码质量

  • 审查意见:保留了 SPDX(Software Package Data Exchange)标识符,用于声明版权和许可证信息。
  • 评价质量良好
  • 原因:维护清晰的版权和许可证声明是开源项目的重要实践。修改后的格式符合 CMake 文件的标准头部注释风格,提高了代码的可读性和规范性。

3. 代码性能

  • 审查意见:这部分代码仅在 CMake 配置阶段(处理 find_package 时)被解析一次。
  • 评价无性能影响
  • 原因:这属于元数据配置,不涉及编译后的运行时逻辑。因此,注释格式的改变对构建时间或运行时性能没有任何影响。

4. 代码安全

  • 审查意见:许可证声明为 GPL-3.0-or-later
  • 评价合规性良好
  • 原因:正确声明许可证有助于法律合规性。虽然这只是注释,但在法律纠纷中,文件头部的声明是重要的证据。确保其正确性是代码安全(法律层面)的一部分。

总结与改进建议

这段 diff 是一个修正性提交,修复了 CMake 文件中的语法错误。

改进建议:

  1. 年份检查:代码中的年份写的是 2026。除非这是一个为了未来日期预留的项目,否则这看起来像是一个笔误。建议确认是否应改为当前年份(如 20232024)。
  2. 一致性:建议检查项目中是否还有其他 .cmake.cmake.in 文件错误地使用了 // 注释,确保整个项目构建系统的风格统一。

修改后的代码片段(修正年份假设):

# SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: GPL-3.0-or-later

@PACKAGE_INIT@
include(CMakeFindDependencyMacro)

@wjyrich wjyrich merged commit ae4d31e into linuxdeepin:master Apr 29, 2026
10 of 12 checks passed
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.

4 participants