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

Failed to run pre-commit hook #1408

Closed
berberman opened this issue Feb 20, 2021 · 4 comments · Fixed by #1411
Closed

Failed to run pre-commit hook #1408

berberman opened this issue Feb 20, 2021 · 4 comments · Fixed by #1411

Comments

@berberman
Copy link
Collaborator

I couldn't commit without specifying --no-verify...

$ nix-shell
$ git commit -m "..."
stylish-haskell..........................................................Failed
- hook id: stylish-haskell
- exit code: 1

stylish-haskell: 0:0:Language.Haskell.Stylish.Config.loadConfig: fromJSON: expected Bool, but encountered String

CallStack (from HasCallStack):
  error, called at lib/Language/Haskell/Stylish/Config.hs:107:32 in stylish-haskell-0.11.0.3-F2KP2B6JiKw5YfjeWoLVgI:Language.Haskell.Stylish.Config
@Ailrun
Copy link
Member

Ailrun commented Feb 20, 2021

Do you know what part of the config caused the problem? I cannot reproduce it at least only with stylish-haskell command line.

@berberman
Copy link
Collaborator Author

Hmm stylish-haskell does run successfully from command line, but executing the hook manually would fail, even if I removed all .stylish-haskell.yaml files.

$ .git/hooks/pre-commit
stylish-haskell..........................................................Failed
- hook id: stylish-haskell
- exit code: 1

stylish-haskell: 0:0:Language.Haskell.Stylish.Config.loadConfig: fromJSON: expected Bool, but encountered String

CallStack (from HasCallStack):
  error, called at lib/Language/Haskell/Stylish/Config.hs:107:32 in stylish-haskell-0.11.0.3-F2KP2B6JiKw5YfjeWoLVgI:Language.Haskell.Stylish.Config

@Ailrun
Copy link
Member

Ailrun commented Feb 20, 2021

That's weird, when I call stylish-haskell directly in the shell, I got stylish-haskell 0.12.2.0, but the hook executes stylish-haskell-0.11.0.3...

@Ailrun
Copy link
Member

Ailrun commented Feb 20, 2021

I see, it's because nix-pre-commit-hooks uses its own source, and we need to somehow replace it with our source...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants