Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: format cmakelists.txt #283

Merged
merged 1 commit into from
Nov 28, 2024
Merged

Conversation

rb-union
Copy link
Contributor

As title.

Log: Format CMakeLists.txt

As title.

Log: Format CMakeLists.txt
@deepin-ci-robot
Copy link

deepin pr auto review

代码审查意见:

  1. CMakeLists.txt 文件中的条件判断

    • CMakeLists.txt 文件中,条件判断语句的括号使用不一致,建议统一使用 () 而不是 ()()。例如:
      if (NOT DEFINED VERSION)
          set(VERSION 5.3.9)
      endif()
  2. 注释风格

    • 注释应该使用统一的风格,例如在 CMakeLists.txt 文件中,注释应该使用 # 而不是 #。例如:
      # 安全测试的开关
      set(CMAKE_SAFETYTEST OFF)
  3. 代码缩进

    • 代码缩进应该统一,例如在 CMakeLists.txt 文件中,if 语句后面的代码应该缩进。例如:
      if (CMAKE_BUILD_TYPE STREQUAL "Debug")
          add_subdirectory(tests)
      endif()
  4. 变量命名

    • 变量命名应该遵循一致的命名规范,例如在 CMakeLists.txt 文件中,VERSION 变量应该使用大写字母。例如:
      set(VERSION 5.3.9)
  5. 代码重复

    • 代码中存在重复的代码块,例如在 CMakeLists.txt 文件中,set(CMAKE_C_FLAGS ...)set(CMAKE_CXX_FLAGS ...) 在不同的地方被重复设置。建议将这些设置合并到一个地方。
  6. 未使用的代码

    • 代码中存在未使用的代码块,例如在 CMakeLists.txt 文件中,# add_subdirectory(tests/FuzzyTest) 应该被删除。
  7. 安全性

    • CMakeLists.txt 文件中,execute_process 命令没有对输出进行错误处理,可能会导致安全问题。建议添加错误处理逻辑。
  8. 性能

    • CMakeLists.txt 文件中,execute_process 命令的 TIMEOUT 参数设置为 5,可能不足以处理所有情况。建议根据实际情况调整超时时间。
  9. 代码风格

    • 代码风格应该遵循一致的规范,例如在 CMakeLists.txt 文件中,set 命令后面的空格应该保持一致。例如:
      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -fprofile-arcs -ftest-coverage")
  10. 注释

    • 代码中的注释应该清晰明了,例如在 CMakeLists.txt 文件中,注释应该解释为什么需要执行某个操作。例如:
      # 检查qapt版本
      execute_process(COMMAND dpkg -s libqapt-dev
                      COMMAND grep Version
                      TIMEOUT 5
                      OUTPUT_VARIABLE QAPT_VERSION_STR)

以上是针对代码审查意见的详细说明,希望能够对您有所帮助。

@rb-union rb-union merged commit 8be69fc into linuxdeepin:master Nov 28, 2024
20 checks passed
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pengfeixx, rb-union, starhcq

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

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

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