Skip to main content
Follow this workflow when contributing to Erst to ensure smooth collaboration and maintain code quality.

Branch naming

Create descriptive branch names based on the type of work:
  • Features: feat/my-feature-name
  • Bug fixes: fix/issue-description
  • Documentation: docs/update-description
  • Refactoring: refactor/component-name
  • Tests: test/test-description

Development steps

1

Sync with main branch

Before starting work, ensure your local main branch is up to date:
2

Create a new branch

Create a branch for your feature or bug fix:
3

Make your changes

Write your code following the code standards.
4

Test locally

Run all tests and linting before committing:
Or use Make targets:
5

Commit your changes

Follow the commit message convention:
6

Push and create a pull request

Push your branch and create a PR on GitHub:
Then create a PR with a detailed description.
7

Address review feedback

Make requested changes, commit, and push:

Commit message convention

Erst follows the Conventional Commits specification:

Types

  • feat: A new feature
  • fix: A bug fix
  • test: Adding or improving tests
  • docs: Documentation changes
  • refactor: Code refactoring without feature changes
  • perf: Performance improvements
  • chore: Build, CI, or dependency updates
  • ci: CI/CD configuration changes

Scopes

Use specific areas of the codebase:
  • sim: Simulator (Rust)
  • cli: CLI interface (Go)
  • updater: Update mechanism
  • trace: Trace viewer
  • analyzer: Transaction analyzer
  • rpc: RPC client

Examples

Commit rules

  • Keep subject under 50 characters
  • Use imperative mood: “add” not “added” or “adds”
  • No period at the end of the subject
  • Provide detailed explanation in the body if the change is non-obvious
  • Reference related issues: Closes #350, Refs #343
Never use emojis in commit messages or PR titles.

Pull request structure

Create clear, well-documented pull requests:

PR title

Follow the same format as commit messages:

PR description template

PR checks

Before submitting, ensure:
  • All CI checks pass
  • Code coverage doesn’t decrease
  • All tests pass locally
  • Strict linting passes (make lint-all-strict)
  • Documentation is updated if needed
The CI pipeline will automatically run tests, linting, and coverage checks. PRs with failing checks will not be merged.

Formatting and linting

Run formatting and linting before every commit:

Format code

Run linting

Using pre-commit hooks

Install pre-commit hooks to automatically check your code:
1

Install pre-commit

2

Install hooks

Or use Make:
3

Run manually

Test the hooks on all files:
Pre-commit hooks will automatically:
  • Format Go code with gofmt
  • Format Rust code with cargo fmt
  • Run golangci-lint
  • Run cargo clippy
  • Check for merge conflicts
  • Validate YAML files

Code review checklist

When reviewing PRs, ensure:
  • Code follows naming and style conventions
  • Error handling is appropriate
  • Tests are adequate and pass
  • Documentation is clear and complete
  • No unnecessary dependencies added
  • Performance implications considered
  • Security implications reviewed
  • Commit messages follow convention
  • No dead code or unused variables
  • Linting passes without suppressions (unless justified)

Common development tasks

Addressing review feedback

When maintainers request changes:
  1. Make the requested changes in your local branch
  2. Commit with a descriptive message: fix: address review comments on error handling
  3. Push to your branch: git push origin feat/my-feature
  4. Reply to comments explaining your changes
  5. Re-request review when ready
Don’t force-push unless you’re rebasing or squashing commits. Regular pushes preserve the review history.

Rebasing and squashing

Before merging, you may be asked to rebase or squash commits:
Only force-push to your feature branch, never to main. Be careful when force-pushing to branches others are working on.

Getting unblocked

If you’re stuck:
  • Review the documentation in docs/
  • Check existing issues for similar problems
  • Ask in GitHub Discussions for general questions
  • Create an issue for specific bugs or feature questions
  • Tag maintainers in your PR if you need guidance

Important reminders

  • No emojis in commit messages or PR titles
  • No vague messages like “fixes stuff” or “updates things”
  • Always run strict linting before pushing
  • All tests must pass before requesting review
  • Update documentation when changing functionality
  • Reference issues in commit messages and PRs