Skip to content

Fix pre-commit top-level exclude regex broken by YAML block scalar trailing newline#3425

Merged
juliusvonkohout merged 2 commits into
unify-yamllintfrom
copilot/sub-pr-3418
Mar 26, 2026
Merged

Fix pre-commit top-level exclude regex broken by YAML block scalar trailing newline#3425
juliusvonkohout merged 2 commits into
unify-yamllintfrom
copilot/sub-pr-3418

Conversation

Copilot AI commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

The top-level exclude in .pre-commit-config.yaml used a YAML block scalar (|), which silently appends a trailing \n to the regex string. pre-commit compiles this verbatim, so the pattern never matched any file path, leaving upstream/ paths unexcluded for hooks without their own exclude.

Change

Convert exclude from block scalar to a single-line quoted scalar:

# Before — trailing newline breaks the regex
exclude: |
  (^|.*/)upstream/.*

# After — exact regex, no trailing newline
exclude: '(^|.*/)upstream/.*'

⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

Copilot AI review requested due to automatic review settings March 26, 2026 09:58
@github-actions

Copy link
Copy Markdown

Welcome to the Kubeflow Manifests Repository

Thanks for opening your first PR. Your contribution means a lot to the Kubeflow community.

Before making more PRs:
Please ensure your PR follows our Contributing Guide.
Please also be aware that many components are synchronizes from upstream via the scripts in /scripts.
So in some cases you have to fix the problem in the upstream repositories first, but you can use a PR against kubeflow/manifests to test the platform integration.

Community Resources:

Thanks again for helping to improve Kubeflow.

Copilot AI removed the request for review from Copilot March 26, 2026 09:58
@google-oss-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please ask for approval from juliusvonkohout. For more information see the Kubernetes Code Review Process.

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

Details 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

Copilot AI changed the title [WIP] [WIP] Address feedback on .yamllint.yaml configuration settings refinement Fix pre-commit top-level exclude regex broken by YAML block scalar trailing newline Mar 26, 2026
Copilot AI requested a review from juliusvonkohout March 26, 2026 09:59
@juliusvonkohout juliusvonkohout marked this pull request as ready for review March 26, 2026 10:00
Copilot AI review requested due to automatic review settings March 26, 2026 10:00
@google-oss-prow google-oss-prow Bot requested a review from kimwnasptd March 26, 2026 10:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the repository’s pre-commit configuration so the global exclude regex correctly excludes upstream/ paths for hooks that do not define their own exclude.

Changes:

  • Replace the top-level exclude YAML block scalar with a single-line quoted scalar to avoid an implicit trailing newline in the regex.

@juliusvonkohout juliusvonkohout merged commit fa8eff3 into unify-yamllint Mar 26, 2026
10 of 11 checks passed
@juliusvonkohout juliusvonkohout deleted the copilot/sub-pr-3418 branch March 26, 2026 10:03
google-oss-prow Bot pushed a commit that referenced this pull request Mar 26, 2026
* Refine .yamllint.yaml configuration settings

Updated .yamllint.yaml configuration options for clarity and consistency.

Signed-off-by: Julius von Kohout <45896133+juliusvonkohout@users.noreply.github.com>

* Update linting_bash_python_yaml_files.yaml

Signed-off-by: Julius von Kohout <45896133+juliusvonkohout@users.noreply.github.com>

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Julius von Kohout <45896133+juliusvonkohout@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Julius von Kohout <45896133+juliusvonkohout@users.noreply.github.com>

* Update .pre-commit-config.yaml

Signed-off-by: Julius von Kohout <45896133+juliusvonkohout@users.noreply.github.com>

* fix yamllint workflow and refresh versions (#3423)

* test: refresh yamllint tooling

Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>

* Update .github/workflows/linting_bash_python_yaml_files.yaml

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: hippie-danish <133037056+danish9039@users.noreply.github.com>

* test: install yamllint on PATH

Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>

* test: keep yamllint exclusions in config

Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>

---------

Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>
Signed-off-by: hippie-danish <133037056+danish9039@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix pre-commit top-level exclude regex broken by YAML block scalar trailing newline (#3425)

* Initial plan

* Fix top-level exclude block scalar in .pre-commit-config.yaml

Co-authored-by: juliusvonkohout <45896133+juliusvonkohout@users.noreply.github.com>
Agent-Logs-Url: https://github.com/kubeflow/manifests/sessions/7bc9cd3a-d1b3-416a-be8b-19087f67c814

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: juliusvonkohout <45896133+juliusvonkohout@users.noreply.github.com>

---------

Signed-off-by: Julius von Kohout <45896133+juliusvonkohout@users.noreply.github.com>
Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>
Signed-off-by: hippie-danish <133037056+danish9039@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: hippie-danish <133037056+danish9039@users.noreply.github.com>
Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants