Skip to content

Latest commit

 

History

History
137 lines (92 loc) · 3.27 KB

File metadata and controls

137 lines (92 loc) · 3.27 KB

Contributing to AssertC

Thank you for your interest in contributing to AssertC! This document provides guidelines and information for contributors.

Getting Started

Prerequisites

  • GCC or Clang compiler
  • Make
  • Git

Setting Up the Development Environment

  1. Fork the repository on GitHub

  2. Clone your fork locally:

    git clone https://github.com/your-username/assertc.git
    cd assertc
  3. Build the project:

    make
  4. Run the tests to ensure everything is working:

    make tests

Code Style

We use a consistent code style throughout the project. Please follow these guidelines:

  • Indentation: Use spaces (4 spaces wide)
  • Naming: Use snake_case for functions and variables
  • Comments: Use // for single-line comments, /* */ for multi-line
  • Header guards: Use #ifndef style guards in header files
  • Line length: Keep lines under 80 characters when possible

The project includes an .editorconfig file that will automatically configure your editor for the correct style.

Making Changes

Before You Start

  1. Check existing issues to see if your idea is already being discussed
  2. For new features, consider opening an issue first to discuss the approach
  3. Make sure all existing tests pass before making changes

Development Workflow

  1. Create a new branch for your feature/bugfix:

    git checkout -b feature/your-feature-name
  2. Make your changes

  3. Add tests for any new functionality

  4. Ensure all tests pass:

    make test
  5. Commit your changes with a clear message:

    git commit -m "feat: description of what you added"
  6. Push to your changes and create a pull request

Writing Tests

  • All new functionality should include tests
  • Tests should be placed in the tests/ directory
  • Use the TEST() macro for test functions
  • Follow the existing test naming convention: test_<functionality>
  • Test both success and failure cases where applicable

Example test structure:

#include <assertc.h>

TEST(test_new_feature) {
    // Test your new feature
    assert_eq(expected_result, actual_result);
}

Pull Request Guidelines

  • Keep pull requests focused on a single feature or bugfix
  • Include a clear description of what your changes do
  • Reference any related issues
  • Ensure all tests pass
  • Update documentation if needed
  • Follow the existing code style

Reporting Issues

When reporting bugs, please include:

  • A clear description of the problem
  • Steps to reproduce the issue
  • Expected vs actual behavior
  • Your operating system and compiler version
  • Any relevant error messages

Feature Requests

We welcome feature requests! Please:

  • Check if the feature has already been requested
  • Provide a clear description of the proposed feature
  • Explain the use case and why it would be beneficial
  • Consider whether it fits with the project's goals of being lightweight and simple

Questions

If you have questions about contributing, feel free to:

  • Open an issue for discussion
  • Check existing issues and pull requests for similar topics

License

By contributing to AssertC, you agree that your contributions will be licensed under the same license as the project.

Thank you for contributing to AssertC! 🎉