Closed w0aw closed 1 year ago
Thanks for your report.
✔ Reverting to original state because of errors... husky - pre-commit hook exited with code 1 (error)
This step indicates some errors happened during lint_staged running, you can add VERBOSE=true
in pre-commit
hook to print verbose log:
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
VERBOSE=true dart run lint_staged
lint_staged:execGit - git -c submodule.recurse=false log -1
lint_staged:execGit - git -c submodule.recurse=false diff --name-only -z --diff-filter=ACMR --staged
lint_staged:run - Loaded list of staged files int git:
[lib/main.dart]
lint_staged:run - Found configs: {lib/.dart: [dart format]}
lint_staged:run - lib/main.dart matches lib/.dart is true
lint_staged:run - matched files: {lib/main.dart}
lint_staged:run - matched file chunks: [[lib/main.dart]]
lint_staged:execGit - git -c submodule.recurse=false rev-parse --git-dir
⠙ Preparing lint_staged...
lint_staged:GitWorkflow - Backing up original state...
lint_staged:GitWorkflow - Getting partially staged files...
lint_staged:execGit - git -c submodule.recurse=false status -z
lint_staged:GitWorkflow - Found partially staged files: []
lint_staged:GitWorkflow - Backing up merge state...
lint_staged:GitWorkflow - Done backing up merge state!
lint_staged:GitWorkflow - Getting deleted files...
lint_staged:execGit - git -c submodule.recurse=false ls-files --deleted
lint_staged:GitWorkflow - Found deleted files: []
lint_staged:execGit - git -c submodule.recurse=false stash create
lint_staged:execGit - git -c submodule.recurse=false stash store --quiet --message lint_staged automatic backup d58bab906eb4a43b61ecfd1ecf39a1b37f029001
lint_staged:GitWorkflow - Done backing up original state!
✔ Preparing lint_staged...
⠙ Running tasks for staged files...
lint_staged:LintRunner - dart format lib/main.dart
⠹ Running tasks for staged files...
⠸ Running tasks for staged files...
⠼ Running tasks for staged files...
⠴ Running tasks for staged files...
✔ Running tasks for staged files...
⠙ Applying modifications from tasks...
lint_staged:GitWorkflow - Adding task modifications to index...
lint_staged:execGit - git -c submodule.recurse=false add -- lib/main.dart
lint_staged:GitWorkflow - Done adding task modifications to index!
lint_staged:execGit - git -c submodule.recurse=false diff --name-only -z --diff-filter=ACMR --staged
lint_staged:GitWorkflow - #0 GitWorkflow.handleError (package:lint_staged/src/git_workflow.dart:403:24)
Thanks for the detailed log message, I'll check it.
Sorry to be late, now 0.4.0
has been published
Thnaks i'll try it out
i am using lint_staged with husky. with following configuration
a. husky/pre-commit
b. pubspec.yml
everything is working fine when we have some actual changes in files. but for testing purpose when i added some extra space in lib/main.dart file, then on commit it is throwing following output and even it do not remove some extra space that i added recently to taste thing.
to double check my dart command. when i execute "dart format ." it removes those extra spaces from main.dart.
CORRECT ME IF I AM AT WRONG PLACE.
thank you