Skip to content

Commit

Permalink
Add development guide
Browse files Browse the repository at this point in the history
  • Loading branch information
anishathalye committed Jan 4, 2025
1 parent 30b31fc commit dfaf627
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions DEVELOPMENT.md
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

0 comments on commit dfaf627

Please sign in to comment.