diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000..b5dfa1f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,59 @@ +name: Bug report +description: Report a reproducible problem in smath +title: "bug: " +labels: + - bug +body: + - type: markdown + attributes: + value: | + Thanks for filing a bug report. + Please provide enough detail for us to reproduce and diagnose the issue. + + - type: textarea + id: summary + attributes: + label: Summary + description: What happened? + placeholder: Briefly describe the bug. + validations: + required: true + + - type: textarea + id: expected + attributes: + label: Expected behavior + placeholder: Describe what you expected to happen. + validations: + required: true + + - type: textarea + id: repro + attributes: + label: Minimal reproduction + description: Include a minimal code snippet or steps to reproduce. + render: cpp + validations: + required: true + + - type: input + id: compiler + attributes: + label: Compiler and version + placeholder: e.g. clang 18.1.8, GCC 14.2, MSVC 19.40 + validations: + required: true + + - type: input + id: platform + attributes: + label: Platform + placeholder: e.g. macOS 15 arm64, Ubuntu 24.04 x86_64, Windows 11 + validations: + required: true + + - type: textarea + id: additional + attributes: + label: Additional context + description: Add logs, screenshots, or links if relevant. diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..0086358 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: true diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 0000000..c11d6ac --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,41 @@ +name: Feature request +description: Propose an enhancement to smath +title: "feat: " +labels: + - enhancement +body: + - type: markdown + attributes: + value: | + Thanks for suggesting an improvement. + Clear use cases help us evaluate feature requests quickly. + + - type: textarea + id: problem + attributes: + label: Problem statement + description: What problem are you trying to solve? + placeholder: Describe the limitation or pain point. + validations: + required: true + + - type: textarea + id: proposal + attributes: + label: Proposed solution + description: Describe the API or behavior you want. + render: cpp + validations: + required: true + + - type: textarea + id: alternatives + attributes: + label: Alternatives considered + description: What other approaches did you consider? + + - type: textarea + id: impact + attributes: + label: Impact and compatibility + description: Any concerns around performance, API compatibility, or migration? diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..ecbc969 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,84 @@ +# Contributing to smath + +Welcome to `smath` contributors! + +This document contains a set of guidelines to contribute to the project. If you feel like there's a mistake or something can be improved to this document, feel free to propose changes in a pull request. + +## Philosophy + +- `smath` itself should be kept header only, in a single file. +- `smath` should be simple and easy to use. + +## Development setup + +You can work with either Nix (recommended, same tooling used in CI) or a local CMake toolchain. + +### Option 1: Nix + +Make sure you have flakes enabled and then execute the following to enter the shell: + +```bash +nix develop +``` + +You can also run `direnv allow` if you have [direnv](https://direnv.net/) installed and configured. + +### Option 2: Local toolchain + +Requirements: + +- C++23-capable compiler +- CMake (3.15+) +- Ninja (recommended) + +### Configure and build + +```bash +cmake -S . -B build -G Ninja -DSMATH_BUILD_TESTS=ON -DSMATH_BUILD_EXAMPLES=ON +cmake --build build +``` + +## Running tests + +```bash +ctest --test-dir build --output-on-failure +``` + +## Code style + +This project uses `clang-format` to maintain a consistent code style. Before opening a pull request, format changed C++ files: + +```bash +git ls-files '*.hpp' '*.cpp' | xargs clang-format -i +``` + +## Pull requests + +- Keep changes focused and scoped to one topic. +- Add or update tests when behavior changes. +- Ensure the project builds and tests pass locally. + +### Commit style + +Use the commit message format: `: `. + +Allowed categories: `feat`, `fix`, `test`, `docs`, `ci`. + +Examples: + +- `feat: add as_matrix() to quaternion` +- `fix: correct mat4 approx_equal ignoring a column` +- `test: add tests for vector swizzle edge cases` +- `docs: fix typo in README.md` +- `ci: update nix build command in pull request workflow` + +If a commit fixes a tracked issue, include an issue-closing footer: `Closes: #` (example: `Closes: #42`). + +## Reporting issues + +When opening an issue, include: + +- what you expected to happen +- what happened instead +- a minimal reproducible example +- compiler and platform details