Contributing
Prerequisites
- Rust 1.70+ (stable)
- Git
- Node.js 18+ (for docs site only)
Build from source
git clone https://github.com/umitkavala/revet.git
cd revet
cargo build
cargo test --workspace
cargo run --bin revet -- --help
Code quality (run before every commit)
cargo fmt
cargo clippy --workspace -- -D warnings
cargo test --workspace
Revet dogfoods itself:
cargo run --bin revet -- review --full crates/
Adding a domain analyzer
- Create
crates/core/src/analyzer/<name>.rs:
pub struct MyAnalyzer;
impl Default for MyAnalyzer { fn default() -> Self { Self } }
impl MyAnalyzer { pub fn new() -> Self { Self } }
impl Analyzer for MyAnalyzer {
fn name(&self) -> &str { "My Analyzer" }
fn finding_prefix(&self) -> &str { "MY" }
fn is_enabled(&self, config: &RevetConfig) -> bool { config.modules.my_module }
fn analyze_files(&self, files: &[PathBuf], repo_root: &Path) -> Vec<Finding> {
// ...
}
}
- Register in
AnalyzerDispatcher::new()inanalyzer/mod.rs - Add
pub my_module: booltoModulesConfiginconfig.rs - Write tests in
crates/core/tests/test_my_analyzer.rs
Adding a language parser
- Add the tree-sitter grammar to
Cargo.toml:
[workspace.dependencies]
tree-sitter-mylang = "0.23"
- Create
crates/core/src/parser/mylang.rsimplementingLanguageParser - Register in
ParserDispatcher::new()inparser/mod.rs - Write tests in
crates/core/tests/test_mylang_parser.rs
Pull request checklist
-
cargo fmtapplied -
cargo clippy --workspace -- -D warningspasses -
cargo test --workspacepasses - New feature documented in
docs/docs/ - README updated if needed
Reporting issues
Please open an issue at github.com/umitkavala/revet/issues.