-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
30b31fc
commit dfaf627
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Development | ||
|
||
Porcupine uses the standard [Go toolchain][golang] for development. | ||
|
||
[golang]: https://go.dev/ | ||
|
||
## Testing | ||
|
||
You can run the tests with: | ||
|
||
```bash | ||
go test ./... | ||
``` | ||
|
||
Some of the tests generate visualizations which must be manually inspected. To make the tests print the path to the generated HTML files, run the tests with the `-v` flag. | ||
|
||
## Formatting | ||
|
||
You can run the Go code formatter with: | ||
|
||
```bash | ||
go fmt ./... | ||
``` | ||
|
||
Additionally, this project uses [Prettier] to format HTML, CSS, and JavaScript files. You can run Prettier (using [npx]) with: | ||
|
||
```bash | ||
npx prettier -w '**/*.{html,css,js}' | ||
``` | ||
|
||
[Prettier]: https://prettier.io/ | ||
[npx]: https://docs.npmjs.com/cli/v11/commands/npx | ||
|
||
## Static analysis | ||
|
||
You can run Go's built-in `vet` tool with: | ||
|
||
```bash | ||
go vet ./... | ||
``` | ||
|
||
This project additionally uses the [staticcheck] tool. You can install it with: | ||
|
||
```bash | ||
go install honnef.co/go/tools/cmd/staticcheck@latest | ||
``` | ||
|
||
You can run staticcheck with: | ||
|
||
```bash | ||
staticcheck -f stylish ./... | ||
``` | ||
|
||
[staticcheck]: https://staticcheck.dev/ | ||
|
||
## Continuous integration | ||
|
||
Testing and static analysis is [run in CI][ci-test]. | ||
|
||
[ci-test]: .github/workflows/ci.yml |