Skip to content

fix(ci): enable trailing whitespace checks - #318

Merged
SigureMo merged 1 commit into
redai-studio:mainfrom
ooooo-create:fix/trailing-whitespace-types-or
Sep 15, 2026
Merged

SigureMo merged 1 commit into
redai-studio:mainfrom
ooooo-create:fix/trailing-whitespace-types-or

Conversation

@ooooo-create

@ooooo-create ooooo-create commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

What

Make trailing-whitespace run on the configured file types instead of reporting (no files to check)Skipped, using a single-line types_or list. After the fix and cleanup, it reports Passed.

Why

types combines tags with AND, so a file had to match python, yaml, json, shell, c, and proto simultaneously. No files matched, even with --all-files, leaving trailing whitespace unchecked.

How

  • Set types_or: [python, yaml, json, shell, c, proto] to match any of the six language tags. Keep the existing language list, inherited text filter, and transfer_queue/ exclusion.
  • Remove the existing trailing whitespace exposed by the working hook: 33 lines across 11 shell scripts. These cleanups are needed for the newly enabled full-repository check to pass. Ignoring whitespace at line endings leaves only the hook configuration change.

Testing

  • pre-commit run --all-files passes
  • Tests pass (pytest tests/)
  • New tests added (if applicable)
  • Documentation updated (if applicable)

Validation details:

  • pre-commit run --all-files --show-diff-on-failure and prek run --all-files: all hooks passed, including trailing-whitespace.
  • bash -n: passed for all 11 changed shell scripts.
  • git diff --check: passed.
  • pytest tests/: not run locally because the changes are limited to hook filtering and trailing whitespace. GPU integration tests require multi-node GPU hardware and were not run.
  • New tests and documentation updates: not applicable to this configuration fix.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • CI/CD or build changes

Screenshots / Logs

Actual terminal output from the same command before and after the fix (prek 0.5.2):

Before — original configuration:

$ prek run trailing-whitespace --all-files --verbose
trim trailing whitespace.............................(no files to check)Skipped

After — fixed configuration and existing whitespace cleaned up:

$ prek run trailing-whitespace --all-files --verbose
trim trailing whitespace.................................................Passed
- hook id: trailing-whitespace
- description: trims trailing whitespace
- duration: 0.05s

The first run after correcting the filter found and fixed the 11 scripts, returning Failed because files were modified. The output above is from the successful rerun with those cleanups included.

Copilot AI lite review requested due to automatic review settings September 15, 2026 14:48

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

# 🐛 Bug Fix

- Set trailing-whitespace to the inline YAML list
  `types_or: [python, yaml, json, shell, c, proto]` so files match any
  configured language tag instead of requiring every tag.
- Remove trailing whitespace from 33 lines across 11 shell scripts so
  the newly enabled check passes on all tracked files.
- Preserve the language list and transfer_queue exclusion.

## Validation

- pre-commit run --all-files --show-diff-on-failure: passed
- prek run --all-files: passed
- trailing-whitespace: (no files to check)Skipped before, Passed after
- bash -n: passed for all 11 changed shell scripts
Copilot AI review requested due to automatic review settings September 15, 2026 14:52
@ooooo-create
ooooo-create force-pushed the fix/trailing-whitespace-types-or branch from c529fa8 to 25666e2 Compare September 15, 2026 14:52

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@rai-studio-bot

rai-studio-bot commented Sep 15, 2026

Copy link
Copy Markdown

Nyanpasu 审查看板

审查状态: ✅ 已通过

审查版本: 25666e2717fdab9f22b608b5552aba86d5976278

已完成 12 个文件的审查,未发现需修改的问题。11 个脚本的 33 行改动均仅清理行尾空白;本地 bash -n、git diff --check 通过,CI 全仓库 Pre-commit Checks 通过。Python 3.10–3.12 测试仍在运行;本地未运行 pytest,无多节点 GPU 硬件,未执行硬件集成测试。

没有未解决的审查问题。

Powered by Nyanpasu with gpt-6-astra medium, please check the suggestions carefully.

@rai-studio-bot rai-studio-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.

已完成对 25666e2 的审查,未发现需要修改的问题,同意合入。types_or 符合官方 OR 筛选语义,并保留上游 text 筛选和现有目录排除。

本地确认 11 个脚本仅清理 33 行行尾空白,bash -ngit diff --check 均通过;CI Pre-commit Checks 已通过。Python 3.10–3.12 测试仍在运行。本地未运行 pytest;本次为配置和空白修复,多节点 GPU 集成测试因无相应硬件未执行。

Powered by Nyanpasu with gpt-6-astra medium, please check the suggestions carefully.

@SigureMo SigureMo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTMeow 🐾

@SigureMo
SigureMo merged commit 6701cae into redai-studio:main Sep 15, 2026
4 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