Skip to content

Commit

Permalink
[#530] Apply contribution tools documentation on backend module
Browse files Browse the repository at this point in the history
In adherence to the user story's objective of implementing code
formatting and checks for the backend to ensure a consistent code style,
this commit enhances the documentation within the backend module. By
incorporating instructions on utilizing development tools like `hlint`,
`stylish-haskell`, and `Haskell-Language-Server` within the README.md
file, developers gain valuable insights into applying linting,
formatting, and language server capabilities to optimize the code
quality and maintain uniformity across the backend project.
  • Loading branch information
placek committed Mar 26, 2024
1 parent c4b8638 commit 9293c81
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions govtool/backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This is a backend application of GovTool project.

## Prerequisites

In order to run `backend` your host machine will need access to the `cardano-db-sync` postgres database. To have this database running locally you'll need:
* `cardano-node`
* `cardano-db-sync`
Expand All @@ -18,6 +19,8 @@ You will need your `cardano-node` and `cardano-db-sync` to be compatible with Sa

[`sancho` testnet config files](https://sancho.network/tutorials/start-node/)

You can utilize the [docker-compose.node+dbsync.yml](../../scripts/govtool/docker-compose.node+dbsync.yml) file to setup the required services.

### Using Nix and Direnv

Due to problems with openapi3 package it's hard to build this project with plain `ghc` and `cabal-install`. Until the prolem is solved we reccomend using `nix` - this problem is fixed when you build your project from inside of the nix shell.
Expand Down Expand Up @@ -51,3 +54,21 @@ Due to problems with openapi3 package it's hard to build this project with plain
```
> [!WARNING]
> In the context of our ongoing project enhancements, it is assumed that the executable previously known as 'vva-be' should be now officially renamed to 'govtool-backend'. This change is necessary for aligning with the updated branding and functional scope of the application and it has to be implemented in the near future as a chore and refactoring ticket. Make sure that the documentation matches the actual name of the executable.

## Development

### Linter

In the development environment in Nix, the [`hlint`](https://github.com/ndmitchell/hlint) tool is readily available to verify Haskell files.

By using `hlint`, developers can ensure that their code adheres to best practices and follows appropriate guidelines. By incorporating `hlint` into the development process, developers can catch potential errors and make necessary improvements early on, ultimately leading to more efficient and robust software development.

### Formatter

To easily format Haskell code, ensuring consistency and readability across the codebase the [`stylish-haskell`](https://github.com/haskell/stylish-haskell) formatter has been introduced into the nix configuration.

Developers can streamline the process of formatting their code, reducing the time and effort required for manual formatting.

### HLS

Developers can use the IDE integrations for Language Server Protocol (LSP) by utilising the [Haskell-Language-Server](https://github.com/haskell/haskell-language-server) that include support for GHC 9.2.7. Using such integration, developers can ensure a seamless and efficient experience with Haskell code in their IDE.

0 comments on commit 9293c81

Please sign in to comment.