Skip to content

Exclude symlink from pre-commit end-of-file-fixer #24490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

l0rd
Copy link
Member

@l0rd l0rd commented Nov 7, 2024

Git on Windows clones the symlink test/python/requirements.txt as a regular file. That's not a big deal except that pre-commit, executed by winmake.ps1 lint, complains because there is no new line at end of the file.

To fix winmake.ps1 lint we exclude the symlink in pre-commit hook end-of-file-fixer configuration.

Does this PR introduce a user-facing change?

None

@l0rd l0rd marked this pull request as ready for review November 7, 2024 11:14
@openshift-ci openshift-ci bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Nov 7, 2024
Copy link
Member

@Luap99 Luap99 left a comment

Choose a reason for hiding this comment

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

LGTM

but as you pointed should we then add https://github.com/pre-commit/pre-commit-hooks/blob/main/README.md#destroyed-symlinks to the list of checks as well to prevent this issue on new/other links so we avoid broken links

Copy link
Contributor

openshift-ci bot commented Nov 7, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: l0rd, Luap99

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

The pull request process is described here

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

@Luap99
Copy link
Member

Luap99 commented Nov 7, 2024

also minor nit in case you repush s/Excluse/Exclude/ in the commit title

Git on Windows clones the symlink `test/python/requirements.txt`
as a regular file. That's not a big deal except that `pre-commit`,
executed by `winmake.ps1 lint`, complains because there is no new
line at end of the file.

To fix `winmake.ps1 lint` we exclude the symlink in `pre-commit`
hook `end-of-file-fixer` configuration.

Signed-off-by: Mario Loriedo <mario.loriedo@gmail.com>
@l0rd l0rd force-pushed the pre-commit-fix-for-windows branch from 887aa7b to d49497c Compare November 7, 2024 15:37
@baude
Copy link
Member

baude commented Nov 7, 2024

yeah, /lgtm

@baude baude added the lgtm Indicates that a PR is ready to be merged. label Nov 7, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit e3770f5 into containers:main Nov 7, 2024
34 of 38 checks passed
@l0rd l0rd changed the title Excluse symlink from pre-commit end-of-file-fixer Exclude symlink from pre-commit end-of-file-fixer Nov 7, 2024
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Feb 6, 2025
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Feb 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants