Update instructions about dev environment (#220)

This commit is contained in:
Alejandro Serrano 2020-09-04 10:31:57 +02:00 committed by GitHub
parent c7cbe18dca
commit 202c3b7877
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 23 deletions

View File

@ -2,7 +2,7 @@
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"DigitalAssetHoldingsLLC.ghcide",
"haskell.haskell",
"hoovercj.haskell-linter",
"vigoo.stylish-haskell",
"EditorConfig.EditorConfig"

View File

@ -1,37 +1,23 @@
# Development recommendations
Before continuing, make sure you've read:
Most of our developers use using [Visual Studio Code](https://code.visualstudio.com/). In that case, you just have to open the project, and install the recommended extensions. Before continuing, make sure you've read:
- [Alejandro's post on setting up a Haskell development environment](https://www.47deg.com/blog/setting-up-haskell/).
- [Alejandro's post on setting up a Haskell development environment](https://www.47deg.com/blog/setting-up-haskell/), but forget about the Visual Studio Code configuration outlined there.
- [Kowainik's Haskell Style Guide](https://kowainik.github.io/posts/2019-02-06-style-guide).
## VSCode extensions
## Visual Studio Code extensions
To make our lives easier while developing in Haskell, we use the following extensions:
To make our lives easier while developing in Haskell, we use a set of recommended extensions. The first time you open the project, the editor should suggest to install all those you do not have,
- [ghcide](https://marketplace.visualstudio.com/items?itemName=DigitalAssetHoldingsLLC.ghcide), the best thing that happened to Haskell for editors/IDEs! ❤️
- [Haskell](https://marketplace.visualstudio.com/items?itemName=haskell.haskell), the best thing that happened to Haskell for editors/IDEs! ❤️
- [hlint](https://marketplace.visualstudio.com/items?itemName=hoovercj.haskell-linter), another great extension to have suggestions and refactors in Haskell 🛠
- [stylish-haskell](https://marketplace.visualstudio.com/items?itemName=vigoo.stylish-haskell), the formatter we use to prettify the code 💅🏼
- [editorconfig](https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig), to have consistency between different editors and envs 🐀
## stylish-haskell 💅🏼
## Styling 💅🏼
Regarding the formatter, we use the `master` version of [stylish-haskell](https://github.com/jaspervdj/stylish-haskell) to be able to use language pragmas with lowercase, so you'll need to do this locally:
We loosely follow [Kowainik's Haskell Style Guide](https://kowainik.github.io/posts/2019-02-06-style-guide). In order to automate styling, we use [stylish-haskell](https://github.com/jaspervdj/stylish-haskell), for which we provide a `.stylish-haskell.yaml` configuration file.
```sh
$ git clone https://github.com/jaspervdj/stylish-haskell
$ ...
$ cd stylish-haskell && stack install
```
We don't provide any git hook or tool that enforces our style. However, before you propose any PR please make sure to run `stylish-haskell` yourself, and to follow our style guide mentioned above to the extent possible. 😊
If you wan't to automate this for your VSCode, add the following to your `.vscode/settings.json`:
```json
{
"editor.formatOnSave": true
}
```
We don't provide any git hook or tool that enforces our style. By default the provided `.vscode/settings.json` file runs styling on every save. However, before you propose any PR please make sure to run `stylish-haskell` yourself, and to follow our style guide mentioned above to the extent possible. 😊
Happy hacking! 👏🏼