We welcome contributions to the Gates C-to-VHDL translator project.
- Fork the repository and create a new branch for your feature or bugfix
- Write clear, modular code and document your changes
- Add tests or example files to demonstrate new features
- Submit a pull request with a description of your changes
Branch names follow the pattern [label]/[brief-description]:
feature/global-variablesbugfix/parser-null-pointercode-refactor/remove-magic-numbersdocs-refactor/api-referencetests/codegen-coverage
Use past participle, be brief and clear:
Added user authentication module
Fixed null pointer exception in parser
Renamed ambiguous variables, removed magic numbers
All contributions must meet these standards before merging:
- GNU coding standards compliance (https://www.gnu.org/prep/standards/)
- Includes organized: stdlib → third-party → local
- Clear, descriptive naming for structs, functions, and variables
- No magic numbers — use
#defineorconst - No hardcoded values in function calls
- Prefer string functions over regex where possible
- Consistent formatting and structure throughout
- No dead code or unused imports
- No code duplication — extract shared logic into reusable functions (3+ occurrences)
- No file exceeds 500 lines
- Complex logic has comments explaining "why", not "what"
- Code compiles with
-Wall -Wextra -Wpedanticand zero warnings - All tests pass before submitting (
./run_tests.sh)
See docs/source/code_quality.rst for detailed coding standards.
./run_validation.shFor quick local iteration when you do not need the full proof bar yet:
cmake -S . -B build -DENABLE_TESTING=ON
cmake --build build --target gates_tests -j"$(nproc)"
ctest --test-dir build --output-on-failureBefore opening a PR:
- Run
./run_validation.sh - Update
README.mdanddocs/if the public behavior or setup story changed - Add or update tests and checked-in examples when parser/codegen behavior changes
- Update
docs/source/known_issues.rstif the supported C/VHDL contract changed
- Report bugs or feature requests via GitHub Issues
- Include steps to reproduce, expected behavior, and relevant code snippets