Thank you for your interest in contributing to EdgeFEM! This document provides guidelines for contributing to the project.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR-USERNAME/EdgeFEM.git cd EdgeFEM - Build the project following the README instructions
- Run tests to ensure everything works:
ctest --test-dir build -j
feature/description- New featuresfix/description- Bug fixesdocs/description- Documentation updatesrefactor/description- Code refactoring
-
Create a feature branch from
main:git checkout -b feature/your-feature-name
-
Make your changes, following the code style guidelines below
-
Run formatting and linting:
bash tools/lint.sh build
-
Run tests:
ctest --test-dir build -j
-
Commit with clear messages:
git commit -m "Add eigenmode solver for circular waveguides"
- Standard: C++20
- Formatting: clang-format (configuration in
.clang-format) - Static Analysis: clang-tidy (configuration in
.clang-tidy) - Namespace: All code in
namespace edgefem
Run formatting before committing:
clang-format -i src/*.cpp include/edgefem/*.hpp- Version: Python 3.9+
- Style: PEP 8
- Type Hints: Encouraged for public APIs
- Keep functions focused and under 50 lines when possible
- Use descriptive variable names
- Add comments for non-obvious algorithms
- Prefer
constcorrectness in C++
- Tests use simple
assert()macros (no external framework) - Place tests in
tests/directory - Name test files
test_*.cpp - Add appropriate CTest labels (
smoke,pml,abc, etc.)
# All tests
ctest --test-dir build -j
# Quick smoke tests
ctest --test-dir build -L smoke
# Specific test
./build/tests/test_maxwell-
Rebase on latest main:
git fetch origin git rebase origin/main
-
Ensure CI will pass:
- All tests pass
- Code is formatted
- clang-tidy has no warnings
-
Update documentation if needed:
- Update README.md for user-facing changes
- Update API docs for new functions
- Add/update tutorials for new features
- Green CI: All GitHub Actions checks must pass
- Description: Clear explanation of what and why
- Tests: New features need tests; bug fixes need regression tests
- Docs: User-facing changes need documentation updates
- Submit PR against
mainbranch - Address reviewer feedback
- Maintainer merges after approval
Large features or architectural changes require an Architecture Decision Record (ADR):
- Create
docs/adr/NNNN-title.md - Describe context, decision, and consequences
- Get approval before implementation
Include:
- EdgeFEM version (git commit hash)
- Operating system and compiler version
- Minimal reproducing example
- Expected vs actual behavior
Include:
- Use case description
- Proposed API (if applicable)
- Alternative approaches considered
- Open a GitHub Discussion for questions
- Check existing Issues for known problems
By contributing, you agree that your contributions will be licensed under the MIT License.