Skip to content

style: 按 FormatterConfig 统一格式并加 CI 检查 - #46

Merged
residua1 merged 1 commit into
mainfrom
style/formatter-config
Nov 26, 2026
Merged

residua1 merged 1 commit into
mainfrom
style/formatter-config

Conversation

@residua1

Copy link
Copy Markdown
Contributor

接入 FormatterConfig 里的 .clang-format 与 .editorconfig(均逐字节相同),并把 probe.c 按新标准重排。CI 的 format job 查三件事:clang-format --dry-run --Werror(钉 23.1.4)、空白(末尾换行、行尾空白)、C# 空白(dotnet format whitespace,只有它会执行 csharp_* 规则)。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T09:52:14.900339Z 1eade9c New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3f6786cd1f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

set -euo pipefail
sln=$(git ls-files -- '*.slnx' '*.sln' | head -n 1)
if [ -z "$sln" ]; then echo "没有解决方案文件"; exit 0; fi
dotnet format whitespace "$sln" --verify-no-changes

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Format the whole solution before enabling the formatting gate

The new C# check covers the entire solution, but this commit only reformats src/PluginManager.cs. Other included files still violate the new configuration: for example, host/RegressionChecks.cs:95–97 keeps each if and its embedded statement on one line despite csharp_preserve_single_line_statements = false. Consequently, the new format job will reject this checkout once it reaches this step. The CLI documentation confirms that --verify-no-changes “Terminates with a non zero exit code if any files would have been formatted.” Apply the whitespace formatter to all solution files before enabling this gate, or explicitly limit its initial scope.

Useful? React with 👍 / 👎.

@residua1
residua1 force-pushed the style/formatter-config branch from 3f6786c to 6b4ad25 Compare November 26, 2026 09:34
.clang-format 与 .editorconfig 取自 FormatterConfig,逐字节相同。
dotnet format whitespace 收敛了 PluginManager.cs 的既有空白漂移。

CI 的 format job:clang-format(钉 23.1.4)查那一个 probe.c,
.editorconfig 的空白规则由空白步骤查,C# 的 csharp_* 规则交给
dotnet format whitespace —— 只有它会执行这些规则。
@residua1
residua1 force-pushed the style/formatter-config branch from 6b4ad25 to 1eade9c Compare November 26, 2026 09:50
@residua1
residua1 merged commit e9f7493 into main Nov 26, 2026
6 checks passed
@residua1
residua1 deleted the style/formatter-config branch November 26, 2026 10:00
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