Skip to content
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

Do not lint deleted files #4687

Merged
merged 1 commit into from
Jan 21, 2025
Merged

Conversation

facumenzella
Copy link
Contributor

Motivation

While working on something else I noticed that the pre-commit hook is broken, and tries to lint deleted files. This fixes that by checking if the file was deleted

      status=$(git status --porcelain "$file" | cut -c1-2)

It also adds another validation checking if the variables exist before using them, to prevent another error:

.git/hooks/pre-commit: line 52: [: =: unary operator expected
.git/hooks/pre-commit: line 52: [: =: unary operator expected
.git/hooks/pre-commit: line 52: [: =: unary operator expected
.git/hooks/pre-commit: line 52: [: =: unary operator expected
.git/hooks/pre-commit: line 52: [: =: unary operator expected
``

@facumenzella facumenzella added the pr:fix A bug fix label Jan 20, 2025
Copy link
Member

@JayShortway JayShortway left a comment

Choose a reason for hiding this comment

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

THANK YOU! 🙏

@facumenzella facumenzella merged commit b1631bc into main Jan 21, 2025
10 checks passed
@facumenzella facumenzella deleted the fix/run-swiftlint-excluding-deleted branch January 21, 2025 09:58
@vegaro vegaro changed the title fix: Do not lint deleted files Do not lint deleted files Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:fix A bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants