Skip to content

Commit

Permalink
Patch pre-commit-hook to work with GHCIDE/hls-plugin-api codes (#1418)
Browse files Browse the repository at this point in the history
* Fix pre-commit-hook to work with GHCIDE codes

pre-commit does not load stylish-haskell configuration in
subdirectories. As an imperfect workaround, this commit unifies
all stylish-haskell into a single top-level config.

* Update CONTRIBUTING.md

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
Ailrun and mergify[bot] committed Feb 22, 2021
1 parent 02f18ae commit 9d21805
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 140 deletions.
14 changes: 14 additions & 0 deletions .stylish-haskell.yaml
Expand Up @@ -56,8 +56,22 @@ columns: 80
newline: native

language_extensions:
- BangPatterns
- DataKinds
- DeriveFunctor
- DeriveGeneric
- FlexibleContexts
- GeneralizedNewtypeDeriving
- KindSignatures
- LambdaCase
- NamedFieldPuns
- OverloadedStrings
- RecordWildCards
- ScopedTypeVariables
- StandaloneDeriving
- TupleSections
- TypeApplications
- TypeOperators
- ViewPatterns

cabal: true
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Expand Up @@ -17,8 +17,8 @@ If you don't want to use [nix](https://nixos.org/guides/install-nix.html), you c
{
"hooks": [
{
"entry": "stylish-haskell -i ",
"exclude": "(/test/testdata/*)",
"entry": "stylish-haskell --inplace",
"exclude": "(test/testdata/.*|hie-compat/.*)",
"files": "\\.l?hs$",
"id": "stylish-haskell",
"language": "system",
Expand Down
74 changes: 0 additions & 74 deletions ghcide/.stylish-haskell.yaml

This file was deleted.

63 changes: 0 additions & 63 deletions hls-plugin-api/.stylish-haskell.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion nix/default.nix
Expand Up @@ -54,7 +54,7 @@ in (import sources.nixpkgs
# default_stages = ["manual" "push"];
hooks = {
stylish-haskell.enable = true;
stylish-haskell.excludes = [ "/test/testdata/*" "/hie-compat/*" ];
stylish-haskell.excludes = [ "test/testdata/.*" "hie-compat/.*" ];
};
};
}

0 comments on commit 9d21805

Please sign in to comment.