-
Notifications
You must be signed in to change notification settings - Fork 160
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
addKtlintCheckGitPreCommitHook always successfully even i broke the rule [pre-commit] #351
Comments
Is |
No, I just run this task |
Which OS are you using? Also note that this hook only checks git staged files. Changed, but non-staged files will be ignored. |
OS? Windows 10, yeah i only checked git staged files |
Do you have a lot of staged files? Probably you are affected by this one: #326 |
no, I only had 1 staged file and broke the rule |
Also note Windows is not officially supported for git hook. You may look into this issue: #270 |
@hardbobby hi, have you solved your issue? |
not yet, because of my peripheral have memory issue to use Linux, ill try later, thanks mate |
In Mac also I am facing the same issue @Tapchicoma. I broke rule only one file, but this is not showing any error or warning? CHANGED_FILES="$(git --no-pager diff --name-status --no-color --cached -- public/trunk/ | awk '$1 != "D" && $2 ~ /.kts|.kt/ { print $2}')" if [ -z "$CHANGED_FILES" ]; then echo "Running ktlint over these files:" ./public/trunk/gradlew -p ./public/trunk --quiet ktlintCheck -PinternalKtlintGitFilter="$CHANGED_FILES" echo "$CHANGED_FILES" | while read -r file; do echo "Completed ktlint hook." |
@ksyamkrishnan generated hook looks correct. Please open a new issue. If you will create a project reproduces your issue - this would be awesome. @hardbobby if you still have this problem and could reproduce it - please add a new comment. |
with latest version still got same problem, ktlintFormat not working on windows 10 |
I have the same issue. I noticed two things:
I'll try to create a PR for this. |
Issue is actually already described in #562 and fixing PR is merged. However this is not released yet. |
Should now be released: |
when using
addKtlintCheckGitPreCommitHook
, mychanged_files
with broken rule still got successfully thenuse addKtlintFormatGitPreCommitHook
facing still same issuesthis is my build gradle on project level
when using
ktlintCheck
mychanged_files
ignored.is that any problem with your
PinternalKtlintGitFilter
?The text was updated successfully, but these errors were encountered: