Skip to content

Adding a custom entry for trailling-whitespace#3812

Merged
openshift-merge-bot[bot] merged 1 commit intoopenstack-k8s-operators:mainfrom
evallesp:add-trailing-whitespace-custom-entry
Apr 8, 2026
Merged

Adding a custom entry for trailling-whitespace#3812
openshift-merge-bot[bot] merged 1 commit intoopenstack-k8s-operators:mainfrom
evallesp:add-trailing-whitespace-custom-entry

Conversation

@evallesp
Copy link
Copy Markdown
Contributor

We're adding a wrapper around trailing-whitespace-fixer, which is the default entry https://github.com/pre-commit/pre-commit-hooks/blob/main/.pre-commit-hooks.yaml#L205

So now, instead of directly call it, we are checking if is there any space in the files, if so, then we add it to the list and we call trailing-whitespace-fixer. if not file, then we don't execute anything and we retrieve success.

Apart of impacting positive as we're not calling by default the trailing-whitespace-fixer python script, now we can see the files that needs to remove the whitespace.

@evallesp evallesp force-pushed the add-trailing-whitespace-custom-entry branch 2 times, most recently from 6807750 to d553d39 Compare March 30, 2026 11:51
@evallesp
Copy link
Copy Markdown
Contributor Author

Output of previous patch version where we got some trailling whitespaces:

[INFO] This may take a few minutes...
fix end of files.........................................................Passed
trim trailing whitespace.................................................Failed
- hook id: trailing-whitespace
- exit code: 1
- files were modified by this hook

create-infra.yml
Fixing create-infra.yml
scripts/create_role_molecule.py
Fixing scripts/create_role_molecule.py
roles/update_containers/defaults/main.yml
Fixing roles/update_containers/defaults/main.yml

We're adding a wrapper around trailing-whitespace-fixer, which is the
default entry https://github.com/pre-commit/pre-commit-hooks/blob/main/.pre-commit-hooks.yaml#L205

So now, instead of directly call it, we are checking if is there any space
in the files, if so, then we add it to the list and we call trailing-whitespace-fixer.
if not file, then we don't execute anything and we retrieve success.

Apart of impacting positive as we're not calling by default the trailing-whitespace-fixer python script,
now we can see the files that needs to remove the whitespace.

Signed-off-by: Enrique Vallespi Gil <evallesp@redhat.com>
@evallesp evallesp force-pushed the add-trailing-whitespace-custom-entry branch from d553d39 to 5911238 Compare March 30, 2026 12:03
@danpawlik danpawlik requested a review from a team April 8, 2026 07:18
@danpawlik
Copy link
Copy Markdown
Contributor

seems nice feature! Thanks @evallesp and @michburk for test

Copy link
Copy Markdown
Contributor

@michburk michburk left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 8, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: michburk

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

The pull request process is described 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

@openshift-ci openshift-ci bot added the approved label Apr 8, 2026
@openshift-merge-bot openshift-merge-bot bot merged commit 9d54532 into openstack-k8s-operators:main Apr 8, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants