circle-exclamation
Deeplint is still in the MVP development phase and not yet available for use.

Contributing

This document provides guidelines and instructions for contributing to the DeepLint project.

Getting Started

Thank you for your interest in contributing to DeepLint! This guide will help you get started with the development process.

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js: Version 22.0.0 or higher

  • pnpm: Version 10.x or higher

  • Git: For version control

Setting Up the Development Environment

  1. Fork the Repository

    Start by forking the DeepLint repository to your GitHub account.

  2. Clone Your Fork

    git clone https://github.com/YOUR_USERNAME/deeplint-cli.git
    cd deeplint-cli
  3. Install Dependencies

    pnpm install
  4. Set Up Environment Variables

    Copy the sample environment file and modify as needed:

    cp .env.sample .env

    Edit the .env file to include your OpenAI API key:

    OPENAI_API_KEY=your_api_key_here
  5. Build the Project

    pnpm build
  6. Run the Development Server

    pnpm dev

    This will start the development server, allowing you to run DeepLint with changes you make to the codebase.

  7. Verify Your Setup

    Run a simple command to verify that your development environment is set up correctly:

    pnpm dev -- --help

    You should see the help output for DeepLint.

Development Workflow

Branch Naming Convention

Use the following naming convention for branches:

  • feature/short-description: For new features

  • fix/short-description: For bug fixes

  • docs/short-description: For documentation changes

  • refactor/short-description: For code refactoring

Examples:

Commit Message Guidelines

Follow these guidelines for commit messages:

  • Use the present tense ("Add feature" not "Added feature")

  • Use the imperative mood ("Move cursor to..." not "Moves cursor to...")

  • Limit the first line to 72 characters or less

  • Reference issues and pull requests liberally after the first line

Example:

Development Process

  1. Create a Branch

  2. Make Your Changes

    Implement your changes, following the coding standards.

  3. Run Tests

    Ensure your changes pass all tests:

  4. Lint Your Code

    Ensure your code follows the linting rules:

  5. Format Your Code

    Ensure your code is properly formatted:

  6. Commit Your Changes

  7. Push to Your Fork

  8. Create a Pull Request

    Go to the DeepLint repositoryarrow-up-right and create a pull request from your fork.

Pull Request Process

  1. Fill in the Pull Request Template

    Provide a clear description of the changes and reference any related issues.

  2. Update Documentation

    Ensure that any new features or changes are documented.

  3. Pass CI Checks

    Make sure your pull request passes all CI checks.

  4. Code Review

    Address any feedback from code reviewers.

  5. Merge

    Once approved, your pull request will be merged.

Code Review Guidelines

As a Contributor

  • Be responsive to feedback

  • Explain your design decisions

  • Break large changes into smaller, more manageable pull requests

  • Test your changes thoroughly

As a Reviewer

  • Be respectful and constructive

  • Focus on the code, not the person

  • Provide specific, actionable feedback

  • Consider the context and constraints

Documentation

Code Documentation

  • Use JSDoc comments for public APIs

  • Document parameters, return values, and exceptions

  • Include examples for complex functions

Example:

Project Documentation

  • Update README.md with any new features or changes

  • Update the documentation in the docs/ directory

  • Create new documentation files as needed

Testing

Writing Tests

  • Write tests for all new features

  • Ensure tests are deterministic and isolated

  • Use mocks for external dependencies

  • Aim for high test coverage

Example:

Running Tests

Debugging

Development Server

Run the development server with debugging enabled:

This will start the server with the Node.js inspector enabled. You can then attach a debugger to it.

VS Code Debugging

A .vscode/launch.json file is provided for VS Code users. You can use the "Debug DeepLint" configuration to debug the application.

To debug a specific command:

  1. Open the file you want to debug

  2. Set breakpoints by clicking in the gutter

  3. Press F5 to start debugging

  4. Select the "Debug DeepLint" configuration

  5. Enter the command arguments when prompted

Example launch configuration:

Common Development Tasks

Adding a New Command

  1. Create a new file in src/commands/ with the naming convention command-name-command.ts

  2. Extend the BaseCommand class

  3. Implement the required methods

  4. The command will be automatically discovered and registered

Example:

Adding a New Configuration Option

  1. Update the configuration types in src/config/types.ts

  2. Update the default configuration in src/config/templates.ts

  3. Update the configuration validation in src/config/validator.ts

  4. Update the documentation in docs/getting-started/configuration.md

Example:

Modifying the Context Builder

  1. Update the context builder implementation in src/context-builder/context/context-builder.ts

  2. Update the context types in src/context-builder/context/context-types.ts

  3. Update the tests in tests/context-builder/

  4. Update the documentation in docs/concepts/context-building.md

Example:

Adding a New Feature to the CLI

  1. Identify the component that needs to be modified

  2. Make the necessary changes

  3. Add tests for the new feature

  4. Update documentation

Example: Adding a --format option to the default command

Community Guidelines

Code of Conduct

We expect all contributors to follow our Code of Conduct (Coming Soon). Please be respectful and constructive in all interactions.

Communication

  • GitHub Issues: For bug reports, feature requests, and discussions

  • Pull Requests: For code contributions

  • Discussions: For general questions and community discussions

Recognition

All contributors will be recognized in the CONTRIBUTORS.md file (Coming Soon).

Resources

Thank You!

Thank you for contributing to DeepLint! Your efforts help make this project better for everyone.

Last updated