nyx/CONTRIBUTING.md

4.3 KiB
Raw Blame History

Contributing to Nyx

First off, thank you for taking the time to contribute! By participating in this project, you agree to abide by the community values and expectations described in our Code of Conduct.

Nyx is duallicensed under MIT and Apache2.0. By submitting code, documentation, or any other material, you agree to license your contribution under these same terms.


Table of Contents

  1. Getting Started

  2. How to Contribute

  3. Development Workflow

  4. Commit & Branching Conventions

  5. Style Guide

  6. Security Policy

  7. Community Standards


Getting Started

Clone the repository and build Nyx in release mode:

git clone https://github.com/<yourorg>/nyx.git
cd nyx
cargo build --release

Run the testsuite:

cargo test

Tip: The first build downloads and compiles several treesitter grammars. Later builds will be faster.


How to Contribute

Bug Reports

  • Search existing issues to ensure the bug has not already been reported.
  • Include steps to reproduce, expected vs. actual behaviour, and your environment details (nyx --version, rustc --version).
  • Attach a minimal code sample if possible.

Feature Requests

We welcome wellmotivated feature proposals. Please describe:

  1. Problem statement what pain point does this solve?
  2. Proposed solution highlevel description, optionally with pseudocode.
  3. Alternatives considered why existing functionality is not enough.

Pull Requests

Every PR should:

  1. Target the main branch.
  2. Contain a single, focused change (small orthogonal fixes are okay).
  3. Pass cargo test, cargo fmt --check, and cargo clippy -- -D warnings.
  4. Update documentation and, when relevant, add tests.
  5. Reference related issue numbers in the description (Fixes #123).

A reviewer will provide feedback within 3 business days. Squashmerge is the default strategy; maintainers may edit commit messages for clarity.


Development Workflow

  1. Fork the repo and create your feature branch:

    git checkout -b feature/myfeature
    
  2. Make your changes, then run:

    cargo fmt
    cargo clippy --all-targets --all-features -- -D warnings
    cargo test
    
  3. Signoff your commits if your employer requires a Developer Certificate of Origin (DCO):

    git commit -s -m "feat: add XYZ"
    
  4. Push the branch and open a PR against main.


Commit & Branching Conventions

  • Branch names: feature/<slug>, fix/<slug>, docs/<slug>

  • Commit style Conventional Commits (simplified):

    type(scope): subject
    
    body (optional)
    
    Type Use for
    feat New functionality
    fix Bug fixes
    docs Documentation only
    refactor Code change without behaviour change
    test Adding or changing tests
    chore Build process, tooling

Style Guide

  • Formatting: run cargo fmt before committing.
  • Linting: CI runs Clippy with -D warnings; keep the tree warningfree.
  • Unsafe Rust: prohibited unless absolutely necessary. Justify with incode comments.
  • Public API stability: avoid breaking changes on exported types and functions without prior discussion.

Security Policy

Please do not open public issues for securitysensitive bugs. Instead, email the maintainers at <security@example.com> with the details and a proof of concept. We aim to acknowledge reports within 48 hours.


Community Standards

We strive to maintain a welcoming and inclusive community. Harassment, discrimination, or other forms of unacceptable behavior will be addressed per the Code of Conduct.

Thank you for helping to make Nyx better!