mirror of
https://github.com/haskell/haskell-language-server.git
synced 2024-09-11 16:56:14 +03:00
Add pre-commit hook for cleaning up mixed-line endings (#2679)
* Update pre-commit hook to include changing line endings
* Fix non-lf lines
* Check pre-commit excludes files
* Revert "Check pre-commit excludes files"
This reverts commit 7b9670f863
.
* Actually add the exclude to contributing docs
* Fix merge failure with previous patch
* Inadvertently overwrote merge
* Add LF option for stylish-haskell and pre-commit file
Co-authored-by: Anton Latukha <anton.latukha@gmail.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
parent
9faa179017
commit
411db02883
2
.gitignore
vendored
2
.gitignore
vendored
@ -32,7 +32,7 @@ test/testdata/**/hie.yaml
|
||||
.shake/
|
||||
|
||||
# pre-commit-hook.nix
|
||||
.pre-commit-config.yaml
|
||||
#.pre-commit-config.yaml
|
||||
|
||||
# direnv
|
||||
/.direnv/
|
||||
|
32
.pre-commit-config.yaml
Normal file
32
.pre-commit-config.yaml
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"repos": [
|
||||
{
|
||||
"hooks": [
|
||||
{
|
||||
"entry": "stylish-haskell --inplace",
|
||||
"exclude": "(^Setup.hs$|test/testdata/.*$|test/data/.*$|test/manual/lhs/.*$|^hie-compat/.*$|^plugins/hls-tactics-plugin/.*$|^ghcide/src/Development/IDE/GHC/Compat.hs$|^ghcide/src/Development/IDE/Plugin/CodeAction/ExactPrint.hs$|^ghcide/src/Development/IDE/GHC/Compat/Core.hs$|^ghcide/src/Development/IDE/Spans/Pragmas.hs$|^ghcide/src/Development/IDE/LSP/Outline.hs$|^plugins/hls-splice-plugin/src/Ide/Plugin/Splice.hs$|^ghcide/test/exe/Main.hs$|ghcide/src/Development/IDE/Core/Rules.hs|^hls-test-utils/src/Test/Hls/Util.hs$)",
|
||||
"files": "\\.l?hs$",
|
||||
"id": "stylish-haskell",
|
||||
"language": "system",
|
||||
"name": "stylish-haskell",
|
||||
"pass_filenames": true,
|
||||
"types": [
|
||||
"file"
|
||||
]
|
||||
}
|
||||
],
|
||||
"repo": "local"
|
||||
},
|
||||
{
|
||||
"repo": "https://github.com/pre-commit/pre-commit-hooks",
|
||||
"rev": "v4.1.0",
|
||||
"hooks": [
|
||||
{
|
||||
"id": "mixed-line-ending",
|
||||
"args": ["--fix", "lf"],
|
||||
"exclude": "test/testdata/.*CRLF*.hs$"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@ -53,7 +53,7 @@ steps:
|
||||
|
||||
columns: 80
|
||||
|
||||
newline: native
|
||||
newline: lf
|
||||
|
||||
language_extensions:
|
||||
- BangPatterns
|
||||
|
@ -199,6 +199,17 @@ If you don't want to use [nix](https://nixos.org/guides/install-nix.html), you c
|
||||
}
|
||||
],
|
||||
"repo": "local"
|
||||
},
|
||||
{
|
||||
"repo": "https://github.com/pre-commit/pre-commit-hooks",
|
||||
"rev": "v4.1.0",
|
||||
"hooks": [
|
||||
{
|
||||
"id": "mixed-line-ending",
|
||||
"args": ["--fix", "lf"],
|
||||
"exclude": "test/testdata/.*CRLF*.hs$"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ import Data.Function (on)
|
||||
import Data.Functor
|
||||
import qualified Data.HashMap.Strict as HM
|
||||
import qualified Data.HashSet as HashSet
|
||||
import Data.Monoid (First(..))
|
||||
import Data.Monoid (First (..))
|
||||
import Data.Ord (Down (Down))
|
||||
import qualified Data.Set as Set
|
||||
import Development.IDE.Core.Compile
|
||||
|
@ -32,9 +32,9 @@ import Data.Aeson (FromJSON (..),
|
||||
Value (Null),
|
||||
genericParseJSON)
|
||||
import qualified Data.Aeson as Aeson
|
||||
import qualified Data.ByteString as BS
|
||||
import Data.Bifunctor (Bifunctor (first),
|
||||
second)
|
||||
import qualified Data.ByteString as BS
|
||||
import Data.Coerce
|
||||
import Data.Either (partitionEithers)
|
||||
import qualified Data.HashMap.Strict as HM
|
||||
|
Loading…
Reference in New Issue
Block a user