Skip to content

Latest commit

 

History

History
187 lines (143 loc) · 4.64 KB

File metadata and controls

187 lines (143 loc) · 4.64 KB

Contributing to antifragile

Thank you for your interest in contributing to antifragile! This document provides guidelines and instructions for contributing.

Development Setup

Note: This project uses Rust edition 2024.

  1. Clone the repository:
git clone https://github.com/minikin/antifragile.git
cd antifragile
  1. Install development dependencies:
    rustup component add rustfmt clippy

Building and Testing

Run all tests

cargo test --all-features

Run specific test suites

# Run only integration tests
cargo test --tests --all-features

# Run only unit tests
cargo test --lib

# Run a specific test file
cargo test --test basic_tests

Check code formatting

cargo fmt --all -- --check

Run linter

cargo clippy --all-targets --all-features -- -D warnings

Build documentation

cargo doc --all-features --no-deps --open

Making Changes

Code Style

  • Follow Rust's official style guidelines
  • Run cargo fmt before committing
  • Ensure cargo clippy produces no warnings
  • Write clear, descriptive commit messages

Testing

  • Add tests for all new functionality
  • Ensure all existing tests pass
  • Integration tests go in the tests/ directory
  • Unit tests go in the same file as the code they test

Documentation

  • Document all public APIs with doc comments
  • Include examples in doc comments where appropriate
  • Update README.md if adding major features

Pull Request Process

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Add tests for your changes
  5. Run the full test suite: cargo test --all-features
  6. Run formatting and linting:
    cargo fmt --all
    cargo clippy --all-targets --all-features -- -D warnings
  7. Commit your changes with a descriptive message
  8. Push to your fork
  9. Open a Pull Request against the main branch

PR Requirements

  • All CI checks must pass
  • Code must be formatted with rustfmt
  • No clippy warnings
  • All tests must pass on Linux, macOS, and Windows
  • Code coverage should not decrease
  • Documentation is updated if needed

Feature Flags

The project uses feature flags for optional functionality:

  • serde: Serialization/deserialization support

When adding new features:

  • Make them optional via feature flags when appropriate
  • Test with and without the feature enabled
  • Document the feature in README.md

Commit Message Format

Use conventional commits format:

type(scope): subject

body

footer

Types:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • test: Adding or updating tests
  • refactor: Code refactoring
  • perf: Performance improvements
  • chore: Maintenance tasks

Examples:

feat(core): add new is_nullish method
fix(serde): correct deserialization of absent fields
docs(readme): update usage examples
test(conversion): add tests for from_nullable

Release Process

Releases are managed by maintainers:

  1. Update version in Cargo.toml
  2. Update CHANGELOG.md
  3. Create a git tag: git tag -a v0.x.y -m "Release v0.x.y"
  4. Push tag: git push origin v0.x.y
  5. GitHub Actions will automatically publish to crates.io

Getting Help

  • Found a bug or have a feature request? Please submit a Pull Request directly. The Issues tab is not available on this repository as we don't have the capacity to manage incoming issues at this time.
  • For questions or ideas, feel free to open a PR with your proposed changes or improvements.

Code of Conduct

  • Be respectful and inclusive
  • Provide constructive feedback
  • Focus on the code, not the person
  • Help create a welcoming environment for all contributors

License

This project is licensed under the MIT License - see the LICENSE file for details.