A comprehensive code review tool supporting multiple languages that integrates with husky hooks.
See documentation for details.
- Multi-language support with configurable language detection
- Integration with husky pre-commit hooks
- Configurable review templates
- YAML configuration support
npm install @jc-vendor/code-reviewTo initialize Husky in your project, run:
npx husky-initnpx code-review install-hook --template security --host http://localhost:8080 --endpoint /api/v1/querynpx code-review pre-commit --template security --host http://localhost:8080 --endpoint /api/v1/querynpx code-review list-templatesThe package supports configuration via external YAML files:
languages.yaml: Defines supported file extensions and languagesprompt-templates.yaml: Defines available review templates
languages:
javascript:
extensions:
- ".js"
- ".jsx"
displayName: "JavaScript"
typescript:
extensions:
- ".ts"
- ".tsx"
displayName: "TypeScript"
python:
extensions:
- ".py"
displayName: "Python"
ignorePatterns:
- "**/node_modules/**"
- "**/.git/**"
- "**/dist/**"
- "**/build/**"
- "**/*.min.js"Choose from various review templates:
security: Focuses on security vulnerabilitiesbest-practices: Reviews for language-specific best practicesstyle: Evaluates code style and formattingperformance: Analyzes performance considerationsmaintainability: Assesses code maintainabilitycomprehensive: Full code review covering all aspects
Select a template with the --template option or set the CODE_REVIEW_TEMPLATE environment variable.
The package connects to your RAG API with configurable host and endpoint settings. The default configuration assumes a service running at http://localhost:8080/api/v1/query.
The package provides seamless integration with Husky to run code reviews as pre-commit hooks. The install-hook command adds the appropriate script to your .husky/pre-commit file.
The package can automatically extract context from Git commit messages:
- Ticket IDs: Extracted using patterns like
#123,PROJ-123 - Additional context: Full commit message is included as additional context
MIT