Strict linting policy
Erst uses a zero-tolerance approach to code quality:- No unused variables, imports, or functions
- No dead code (unless explicitly justified)
- All warnings treated as errors in CI
- Fail-fast enforcement across all environments
Go code standards
Formatting
All Go code must be formatted withgofmt before committing:
Linting
Must passgolangci-lint without errors. The project uses a minimal but strict configuration:
See
.golangci.yml for the complete configuration. Enabled linters include: ineffassign, govet, and typecheck.Naming conventions
- Exported identifiers: Use
PascalCasefor types, functions, and constants - Unexported identifiers: Use
camelCase - Constants: Use
UPPER_SNAKE_CASE - Interfaces: Should end with
-ersuffix (e.g.,Reader,Writer,Logger)
Error handling
Follow Go’s explicit error handling patterns:Documentation
All exported functions and types must have documentation comments:Comments should be complete sentences starting with the name of the item being documented.
Rust code standards
Formatting
All Rust code must be formatted withcargo fmt before committing:
Linting
Must passcargo clippy with strict settings:
simulator/Cargo.toml:
Naming conventions
- Functions and variables: Use
snake_case - Types and traits: Use
PascalCase - Constants: Use
UPPER_SNAKE_CASE
Error handling
PreferResult<T, E> over panics:
Documentation
Document all public functions with doc comments:Running strict linting
Go linting only
golangci-lintwith strict settingsgo vetstatic analysis- Maximum issues per linter: 0
- Maximum same issues: 0
Rust linting only
cargo clippywith all warnings as errors- Pedantic and nursery lints enabled
- Dead code detection
- Unused variable detection
All strict linting
Suppressing false positives
Lints should only be suppressed when they are objectively false positives.When to suppress
- Generated code that cannot be modified
- External dependencies with unavoidable warnings
- Legitimate cases where the lint rule doesn’t apply
Go suppression
Use//nolint comments sparingly and always with justification:
Rust suppression
Use#[allow] attributes with clear justification:
Important guidelines
- No emojis: Commit messages and PR titles should not contain emojis
- No vague language: Avoid messages like “fixes stuff” or “updates things”
- Clear messages: Every commit should have a clear, descriptive message
- Defensive programming: Write code defensively, validate inputs, handle edge cases
- Lint-free code: Only suppress linting errors if they are objectively false positives
Pre-commit hooks
Install pre-commit hooks to catch issues before committing:golangci-lintwith strict settingsgo vetcargo clippywith strict settingscargo fmtcheckgo fmtcheck