Skip to content

Contributing Guide

Thank you for your interest in contributing to Code Context Analyzer!

This guide will help you get started with local development, testing, and submitting changes.


๐Ÿงฐ Prerequisites

  • Python 3.10+
  • pip or poetry
  • Git

๐Ÿ“ฆ Setting Up Locally

git clone https://github.com/ahasanular/code-context-analyzer.git
cd code-context-analyzer
pip install -r requirements.txt

You can also use poetry install if you're using Poetry.


๐Ÿงช Running Tests

This project uses pytest.

pytest

To run tests with coverage:

pytest --cov=parsers

๐Ÿงผ Code Style

  • Follow PEP8 for formatting
  • Use type hints wherever possible
  • Run flake8 & isort before submitting

Format your import:

isort 

Check for linting errors:

flake8

๐Ÿ“ Submitting a Pull Request

  1. Fork the repository
  2. Create a new branch (git checkout -b feature/my-new-feature)
  3. Make your changes
  4. Write tests if applicable
  5. Run tests and linters
  6. Commit and push (git commit -m "Add: my new feature")
  7. Open a Pull Request against master

๐Ÿ”Œ Adding a New Language Parser

  1. Create a new file in analyzer/parsers/ (e.g. go_parser.py)
  2. Implement the ParserProtocol
  3. Register it in the CLI (parsers/__init__.py)
  4. Add tests for the parser

๐Ÿ“š Documentation

Documentation is powered by MkDocs and lives in the docs/ folder.

To preview locally:

mkdocs serve
Or you can see them via
https://ahasanular.github.io/code-context-analyzer/


๐ŸŒ Code of Conduct

Please be respectful and inclusive in all interactions. We follow the Contributor Covenant.


Thanks again for contributing! ๐Ÿ’™ See License.