From c022c18a7fc753045dcd114a61b294089a8a8684 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Thu, 17 Apr 2025 11:26:15 +0200 Subject: [PATCH] doc: add CONTRIBUTING.md --- CONTRIBUTING.md | 43 +++++++++++++++++++++++++++++++++++++++++++ mise/config.toml | 6 ++++++ 2 files changed, 49 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b91b3ca --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,43 @@ +# Contributing + +Thanks for contributing to Octoplex! + +## Development + +### Mise + +Octoplex uses [mise](https://mise.jdx.dev/installing-mise.html) as a task +runner and environment management tool. + +Once installed, you can run common development tasks easily: + +Command|Shortcut|Description +---|---|--- +`mise run test`|`mise run t`|Run unit tests +`mise run test_integration`|`mise run ti`|Run integration tests +`mise run lint`|`mise run l`|Run linter +`mise run format`|`mise run f`|Run formatter +`mise run generate_mocks`|`mise run m`|Re-generate mocks + +### Tests + +#### Integration tests + +The integration tests (mostly in `/internal/app/integration_test.go`) attempt +to exercise the entire app, including launching containers and rendering the +terminal output. + +Sometimes they can be flaky. Always ensure there are no stale Docker containers +present from previous runs, and that nothing is listening or attempting to +broadcast to localhost:1935 or localhost:1936. + +## Opening a pull request + +Pull requests are welcome, but please propose significant changes in a +[discussion](https://github.com/rfwatson/octoplex/discussions) first. + +1. Fork the repo +2. Make your changes, including test coverage +3. Push the changes to a branch +4. Ensure the branch is passing +5. Open a pull request diff --git a/mise/config.toml b/mise/config.toml index 6d9647f..38f1a91 100644 --- a/mise/config.toml +++ b/mise/config.toml @@ -29,6 +29,12 @@ dir = "{{cwd}}" run = "golangci-lint run" alias = "l" +[tasks.fmt] +description = "Run formatter" +dir = "{{cwd}}" +run = "goimports -w ." +alias = "f" + [tasks.generate_mocks] description = "Generate mocks" dir = "{{cwd}}"