Skip to content

Latest commit

Β 

History

History
99 lines (77 loc) Β· 2.76 KB

File metadata and controls

99 lines (77 loc) Β· 2.76 KB

Contributing to CodeVista

Thank you for your interest in contributing! This guide covers how to get started.

Quick Start

# Clone and install
git clone <repo-url> codevista
cd codevista
pip install -e .

# Run analysis
codevista analyze /path/to/project -o report.html

Development Setup

# Install in development mode
pip install -e ".[dev]"

# Run tests
make test

# Run with verbose output
make test-v

Project Structure

codevista/
β”œβ”€β”€ codevista/
β”‚   β”œβ”€β”€ __init__.py      # Package metadata
β”‚   β”œβ”€β”€ cli.py           # Command-line interface
β”‚   β”œβ”€β”€ config.py        # Configuration & ignore patterns
β”‚   β”œβ”€β”€ languages.py     # 90+ language definitions
β”‚   β”œβ”€β”€ analyzer.py      # Core analysis engine
β”‚   β”œβ”€β”€ security.py      # Security scanner (40+ patterns)
β”‚   β”œβ”€β”€ report.py        # HTML report generator
β”‚   β”œβ”€β”€ git_analysis.py  # Git history analysis
β”‚   β”œβ”€β”€ dependencies.py  # Dependency parsing (10+ formats)
β”‚   β”œβ”€β”€ metrics.py       # Code metrics & health scoring
β”‚   β”œβ”€β”€ tech_detector.py # Framework/library detection
β”‚   └── utils.py         # Shared utilities
β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ test_analyzer.py
β”‚   β”œβ”€β”€ test_security.py
β”‚   β”œβ”€β”€ test_metrics.py
β”‚   β”œβ”€β”€ test_report.py
β”‚   └── test_utils.py
β”œβ”€β”€ Makefile
β”œβ”€β”€ pyproject.toml
└── CONTRIBUTING.md

Coding Standards

  • Zero external dependencies β€” CodeVista must work with only the Python standard library
  • Type hints β€” All public functions should have type annotations
  • Docstrings β€” All modules and public functions need docstrings
  • Line length β€” Max 88 characters (Black default)
  • Testing β€” All new features need tests

Adding a New Language

  1. Add extension mapping in languages.py β†’ LANG_MAP
  2. Add GitHub color in LANG_COLORS
  3. Add comment syntax in COMMENT_SYNTAX
  4. Add import patterns in utils.py β†’ extract_imports()
  5. Add function pattern in utils.py β†’ detect_functions()
  6. Add tests in tests/test_analyzer.py

Adding Security Patterns

  1. Add regex pattern tuple to SECRET_PATTERNS or DANGEROUS_PATTERNS in security.py
  2. Add remediation text in _get_remediation()
  3. Add test in tests/test_security.py

Reporting Issues

Please include:

  • CodeVista version (codevista --version)
  • Python version
  • Sample code that triggers the issue
  • Expected vs actual behavior

Pull Request Process

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/name)
  3. Write tests for your changes
  4. Run make test and make lint to verify
  5. Open a pull request with a clear description

License

MIT License β€” see LICENSE for details.