You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Complete contributing guide
With the contents of ./CONTRIBUTING.md (mainly the pre commit hook to format)
* Delete CONTRIBUTING.md
Included in the main documentation
* Move style guidelines
As building and testing are more important imo
* Correct grammar
Co-authored-by: Jan Hrcek <2716069+jhrcek@users.noreply.github.com>
* Note cabal run behaviour
Co-Authored-By: jhrcek
Co-authored-by: Jan Hrcek <2716069+jhrcek@users.noreply.github.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/contributing/contributing.md
+97-10Lines changed: 97 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,6 @@ The Haskell tooling dream is near, we need your help!
6
6
- Follow the [Haskell IDE team twitter account](https://twitter.com/IdeHaskell) for updates and help.
7
7
- Join the [#haskell-tooling channel](https://discord.com/channels/280033776820813825/505370075402862594/808027763868827659) in the Functional Programming discord server. You can join the server via [this invitation](https://discord.gg/9spEdTNGrD).
8
8
9
-
## Style guidelines
10
-
11
-
The project includes a [`.editorconfig`](https://editorconfig.org)[file](https://github.com/haskell/haskell-language-server/blob/master/.editorconfig) with the editor basic settings used by the project.
12
-
However, most editors will need some action to honour those settings automatically.
13
-
For example vscode needs to have installed a specific [extension](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig).
14
-
Please, try to follow those basic settings to keep the codebase as uniform as possible.
15
-
16
9
## Building haskell-language-server
17
10
18
11
The project can be built with both `cabal build` and `stack build`.
@@ -72,11 +65,52 @@ To create binaries:
72
65
73
66
GHC 8.6.5 is not supported here because `nixpkgs-unstable` no longer maintains the corresponding packages set.
74
67
75
-
## Introduction tutorial
68
+
## Testing
76
69
77
-
See the [tutorial](./plugin-tutorial.md) on writing a plugin in HLS.
70
+
The tests make use of the [Tasty](https://github.com/feuerbach/tasty) test framework.
71
+
72
+
There are two test suites in the main haskell-language-server package, functional tests, and wrapper tests.
73
+
Other project packages, like the core library or plugins, can have their own test suite.
74
+
75
+
### Testing with Cabal
76
+
77
+
Running all the tests
78
+
79
+
```bash
80
+
$ cabal test
81
+
```
82
+
83
+
Running just the functional tests
84
+
85
+
```bash
86
+
$ cabal test func-test
87
+
```
88
+
89
+
Running just the wrapper tests
90
+
91
+
```bash
92
+
$ cabal test wrapper-test
93
+
```
94
+
95
+
Running a subset of tests
96
+
97
+
Tasty supports providing
98
+
[Patterns](https://github.com/feuerbach/tasty#patterns) as command
99
+
line arguments, to select the specific tests to run.
100
+
101
+
```bash
102
+
$ cabal test func-test --test-option "-p hlint"
103
+
```
78
104
79
-
## Test your hacked HLS in your editor
105
+
The above recompiles everything every time you use a different test option though.
106
+
107
+
An alternative, which only recompiles when tests (or dependencies) change:
108
+
109
+
```bash
110
+
$ cabal run haskell-language-server:func-test -- -p "hlint enables"
111
+
```
112
+
113
+
### Test your hacked HLS in your editor
80
114
81
115
If you want to test HLS while hacking on it, follow the steps below.
82
116
@@ -97,6 +131,59 @@ To do every time you changed code and want to test it:
97
131
- Restart HLS
98
132
- With VS Code: `Haskell: Restart Haskell LSP Server`
99
133
134
+
## Style guidelines
135
+
136
+
The project includes a [`.editorconfig`](https://editorconfig.org)[file](https://github.com/haskell/haskell-language-server/blob/master/.editorconfig) with the editor basic settings used by the project.
137
+
However, most editors will need some action to honour those settings automatically.
138
+
For example vscode needs to have installed a specific [extension](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig).
139
+
Please, try to follow those basic settings to keep the codebase as uniform as possible.
140
+
141
+
### Formatter pre-commit hook
142
+
143
+
We are using [pre-commit-hook.nix](https://github.com/cachix/pre-commit-hooks.nix) to configure git pre-commit hook for formatting. Although it is possible to run formatting manually, we recommend you to use it to set pre-commit hook as our CI checks pre-commit hook is applied or not.
144
+
145
+
You can configure the pre-commit-hook by running
146
+
147
+
```bash
148
+
nix-shell
149
+
```
150
+
151
+
If you don't want to use [nix](https://nixos.org/guides/install-nix.html), you can instead use [pre-commit](https://pre-commit.com) with the following config.
0 commit comments