Thank you for your interest in contributing to PySweep! We welcome contributions of all forms, including bug reports, feature suggestions, documentation updates, and pull requests.
-
Clone the repository:
git clone https://github.com/yourusername/pysweep.git cd pysweep -
Create and activate a virtual environment (Python 3.12+):
python -m venv .venv # Windows: .venv\Scripts\activate # macOS/Linux: source .venv/bin/activate
-
Install dependencies:
pip install -e .[dev]
We enforce strict linting and type checking:
- Formatting: Run
black . - Linting: Run
ruff check . - Type Checking: Run
mypy . - Testing: Run
pytest
Please make sure all checks pass before submitting a pull request.
PySweep allows you to add custom detectors as plugins without changing the core codebase:
- Create a directory named
.pysweep/pluginsin your project's root. - Create a new python file, e.g.
my_detector.py. - Import the decorators and models from
pysweep:from pysweep.detectors import register_file_detector from pysweep.models import Issue, FileContext from pysweep.config import Config @register_file_detector def detect_custom_pattern(context: FileContext, config: Config): issues = [] # Your custom AST or token detection logic here return issues
- Run
pysweep scan .and PySweep will automatically discover and execute your new detector!