构建警告 193 个,构建常量和工程规范需要整理 [AI Review]

Open
#3,827 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp
Domain
build-system

Research direction

Start by reviewing PCL.Core/PCL.Core.csproj and PCL.Launcher.Core/Launch/Core.cs, then compare project build constants and the reported warning counts in McInstance.cs and the DTO files. The issue proposes shared build settings, platform annotations, nullable fixes, and consistent DEBUGCI/BETA definitions. Done means CI catches new warnings, projects use the same constants, and beta prompt logic works; the issue does not name specific tests or a build command.

Written by the indexing model from the issue text.

Description

⭕ 等待处理

🤖 这条 Issue 由 AI 代码审计批量生成,未经人工逐项复核。基线:dev@2856c2a4(迁移范围 9c4f1544..2856c2a4)。证据来自静态代码分析,欢迎在评论中补充或纠正。

现象

全量 Debug 构建有 193 个警告。项目之间的构建常量也不一致。

证据

  • 全量构建:0 error,193 warning。CA1416 40 个,CS8618 31 个,CS8602 24 个,CS8604 18 个。
  • 警告最多的文件:PCL.Launcher.Core/Minecraft/McInstance.cs 52 个,UpdatesMinioModel.cs 13 个,UpdatesMirrorChyanModel.cs 11 个,MavenComparableVersion.cs 11 个。
  • PCL.Core/PCL.Core.csproj:37-38 定义了 CI,其他项目没有定义 CI、DEBUGCI、BETA。
  • 源码里多处 #if DEBUGCI 永远为假。
  • PCL.Launcher.Core/Launch/Core.cs:34,152 的 #if BETA 也不会生效。
  • LauncherCommon.VersionBranchCode 在 CI 构建中为 0,Basics.Metadata.Version.BranchCode 为 50。

影响

警告太多,新的警告不容易被注意到。CI 构建和发布构建的行为可能不同。

建议

  • 增加 Directory.Build.props,统一 Nullable、LangVersion、分析器和构建常量。
  • Windows 专用类加 [SupportedOSPlatform("windows")],清掉大部分 CA1416。
  • 更新 DTO 的字符串属性初始化,清掉 CS8618。
  • 单独整理 McInstance 的可空性。
  • 统一 DEBUGCI 和 BETA 的定义。

验收

  • 构建警告降到可接受范围,新增警告能被 CI 拦住。
  • 所有项目使用同一组构建常量。
  • Beta 构建的提示逻辑实际生效。
Dominant language
C#
Stars
4.3k
Forks
148
Avg merge
1d 6h
Merged PRs (30d)
64

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PCL-Community/PCL-CE

All issues in PCL-Community/PCL-CE

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.