Skip to content

发布 v0.0.6#11

Merged
Certseeds merged 15 commits intomasterfrom
develop
Sep 20, 2025
Merged

发布 v0.0.6#11
Certseeds merged 15 commits intomasterfrom
develop

Conversation

@Certseeds
Copy link
Owner

Description

主要目标:

  • 命名与依赖对齐:artifactId 与仓库名统一;补充缺失依赖,修复测试编译问题
  • 文档强化:澄清 Java 版本策略、增加“快速上手”;统一用语与命令,修正示例笔误
  • CI 提效:GitHub Actions 取消手工 zip,避免二次压缩,仅由 upload-artifact 压缩一次

变更摘要:

  • POM 与依赖
    • 根 pom:补充 lombok 依赖(scope=provided),解决测试中 @Slf4j 的编译问题
    • 保持编译目标为 Java 11(与 OJ 环境一致),同时 README 推荐本地使用 JDK 21
  • 文档(README)
    • 新增“Java 版本策略(重要)”:本地 JDK21 开发/测试,Maven --release 11 产物兼容 OJ
    • 新增“快速上手(5 分钟)”步骤与 PowerShell 命令
    • 单模块测试命令更优雅:mvn -q -f lab_welcome/lab_welcome_a/pom.xml test(替代 -pl ... -am
    • 纠正文案与示例:将“c++ 重定向”改为“Java 标准 I/O 重定向”;cal_warpper 更正为 cal;去除无用 HTML 换行;统一 OJ/Java 大小写
    • 强调 OJ 单文件提交:快读类需嵌入 Main.java
  • CI(.github/workflows/pull_request.yml)
    • 移除手工 zip 步骤,改为直接用 actions/upload-artifact@v4 上传目录并排除 .git,避免二次压缩
    • 保持跨平台测试矩阵(ubuntu/windows)、JDK 21 测试环境

请参考:该 PR 不引入破坏性变更,主要集中在文档与 CI/构建体验优化。

Fixes # (issue)

  • N/A(无关联的已登记 issue,如需要可在合并前补充)

Type of change

  • Bug fix (non-breaking change which fixes an issue) // 修复测试因缺失 lombok 依赖导致的编译问题
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update // 已更新并强化 README

How Has This Been Tested?

  • GitHub Actions:

    • ubuntu-latest 与 windows-latest 双平台矩阵,JDK 21 环境,执行 mvn clean compile test 验证构建与测试
    • 构建产物上传:确认产物由 upload-artifact 直接压缩,且不包含 .git,无二次压缩
  • 本地验证(Windows PowerShell):

    • mvn -q test 运行根项目测试
    • mvn -q -f lab_welcome/lab_welcome_a/pom.xml test 单模块测试命令可用
  • 文档校对:

    • README 链接/路径与仓库结构一致;命令在 PowerShell 下可执行
  • Test A:GitHub Actions 矩阵构建与测试通过(CI)

  • Test B:单模块测试命令(-f 指定 pom)可执行并通过

Test Configuration:

  • JDK (local): 21 (Temurin)
  • Target release: 11(Maven --release 11)
  • OS: Windows 11 / Ubuntu (CI)
  • Toolchain: Maven 3.9.x
  • SDK: N/A
  • Firmware/Hardware: N/A

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas(README/CI 注释已补充)
  • I have made corresponding changes to the documentation(README 已更新)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works(不涉及新增功能)
  • New and existing unit tests pass locally/CI with my changes
  • Any dependent changes have been merged and published in downstream modules(无跨仓依赖,N/A)

Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
…hm-template-java

Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 20, 2025 05:03
@Certseeds Certseeds added the enhancement New feature or request label Sep 20, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR prepares version 0.0.6 by standardizing naming conventions, updating dependencies, and improving the development workflow. The primary goal is to align the artifactId with the repository name and enhance the project's documentation and CI/CD pipeline.

Key Changes:

  • Project naming alignment: Changed artifactId from CS203_DSAA_template_java to algorithm-template to match repository naming conventions
  • Dependency management: Consolidated lombok and slf4j dependencies to the root POM and updated versions for better compatibility
  • Documentation enhancement: Added Java version strategy section and quick start guide with clearer instructions for OJ submission workflow

Reviewed Changes

Copilot reviewed 102 out of 108 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pom.xml Updated artifactId, version, dependencies, and added project metadata
README.md Extensive documentation improvements with Java version strategy and quick start guide
lab_welcome/*/pom.xml Updated parent artifactId references across all lab modules
.github/workflows/* Simplified CI workflow by removing manual zip operations and updating action versions
Multiple Java files Added consistent SPDX copyright headers
Files not reviewed (6)
  • .idea/.gitignore: Language not supported
  • .idea/codeStyles/.gitignore: Language not supported
  • .idea/codeStyles/Project.xml: Language not supported
  • .idea/codeStyles/codeStyleConfig.xml: Language not supported
  • .idea/vcs.xml: Language not supported
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


1. A+B: lab_00_A ,测试样例
# 仅运行某一题(例如 lab_welcome_a)的测试
mvn -q -pl lab_welcome/lab_welcome_a -am test
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

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

This command conflicts with the earlier statement about using -f for single module testing. Consider removing this line since the recommended approach is shown on line 64 using the -f option.

Suggested change
mvn -q -pl lab_welcome/lab_welcome_a -am test

Copilot uses AI. Check for mistakes.
import java.util.List;

@Slf4j
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

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

Adding @TestMethodOrder annotation without corresponding @order annotations on test methods. Either add @order annotations to the test methods or remove this annotation if test order doesn't matter.

Suggested change
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)

Copilot uses AI. Check for mistakes.
Comment on lines +50 to +54
st = new StringTokenizer("");
}

public boolean hasNext() {
while (!st.hasMoreTokens()) {
Copy link

Copilot AI Sep 20, 2025

Choose a reason for hiding this comment

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

Initializing StringTokenizer with an empty string is unnecessary since it's immediately reassigned in the hasNext() method. Consider initializing as st = null; and adding a null check in hasNext().

Suggested change
st = new StringTokenizer("");
}
public boolean hasNext() {
while (!st.hasMoreTokens()) {
st = null;
}
public boolean hasNext() {
while (st == null || !st.hasMoreTokens()) {

Copilot uses AI. Check for mistakes.
Signed-off-by: Certseeds <51754303+Certseeds@users.noreply.github.com>
@Certseeds Certseeds merged commit c874105 into master Sep 20, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Development

Successfully merging this pull request may close these issues.

3 participants