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
Fork the Repository
Start by forking the DeepLint repository to your GitHub account.
Clone Your Fork
git clone https://github.com/YOUR_USERNAME/deeplint-cli.git cd deeplint-cliInstall Dependencies
pnpm installSet Up Environment Variables
Copy the sample environment file and modify as needed:
cp .env.sample .envEdit the
.envfile to include your OpenAI API key:OPENAI_API_KEY=your_api_key_hereBuild the Project
pnpm buildRun the Development Server
pnpm devThis will start the development server, allowing you to run DeepLint with changes you make to the codebase.
Verify Your Setup
Run a simple command to verify that your development environment is set up correctly:
pnpm dev -- --helpYou should see the help output for DeepLint.
Development Workflow
Branch Naming Convention
Use the following naming convention for branches:
feature/short-description: For new featuresfix/short-description: For bug fixesdocs/short-description: For documentation changesrefactor/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
Create a Branch
Make Your Changes
Implement your changes, following the coding standards.
Run Tests
Ensure your changes pass all tests:
Lint Your Code
Ensure your code follows the linting rules:
Format Your Code
Ensure your code is properly formatted:
Commit Your Changes
Push to Your Fork
Create a Pull Request
Go to the DeepLint repository and create a pull request from your fork.
Pull Request Process
Fill in the Pull Request Template
Provide a clear description of the changes and reference any related issues.
Update Documentation
Ensure that any new features or changes are documented.
Pass CI Checks
Make sure your pull request passes all CI checks.
Code Review
Address any feedback from code reviewers.
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/directoryCreate 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:
Open the file you want to debug
Set breakpoints by clicking in the gutter
Press F5 to start debugging
Select the "Debug DeepLint" configuration
Enter the command arguments when prompted
Example launch configuration:
Common Development Tasks
Adding a New Command
Create a new file in
src/commands/with the naming conventioncommand-name-command.tsExtend the
BaseCommandclassImplement the required methods
The command will be automatically discovered and registered
Example:
Adding a New Configuration Option
Update the configuration types in
src/config/types.tsUpdate the default configuration in
src/config/templates.tsUpdate the configuration validation in
src/config/validator.tsUpdate the documentation in
docs/getting-started/configuration.md
Example:
Modifying the Context Builder
Update the context builder implementation in
src/context-builder/context/context-builder.tsUpdate the context types in
src/context-builder/context/context-types.tsUpdate the tests in
tests/context-builder/Update the documentation in
docs/concepts/context-building.md
Example:
Adding a New Feature to the CLI
Identify the component that needs to be modified
Make the necessary changes
Add tests for the new feature
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