This is the main source code repository of RPL. It contains the toolchain and documentation of RPL.
RPL is a Rust linter which decouples the definition of rules from the detection logic. In particular, RPL consists of two primary components:
- a Domain-Specific Language (DSL) that allows developers to model/define code patterns,
- a detection engine to detect instances of these patterns.
The toolchain of RPL, which is a custom configuration of Rust compiler, enables accurate identification of code instances that demonstrate semantic equivalence to existing patterns.
-
Clone the repository and enter the directory:
git clone https://github.com/RPL-Toolchain/RPL.git && cd RPL -
Install RPL as a cargo subcommand:
cargo install --path . -
Run RPL analysis on your Rust project:
-
check using built-in RPL pattern definitions based on inline MIR:
RPL_PATS=/path/to/RPL/docs/patterns-pest cargo +nightly-2025-02-14 rpl
-
check using built-in RPL pattern definitions based on MIR:
RUSTFLAGS="-Zinline-mir=false" RPL_PATS=/path/to/RPL/docs/patterns-pest cargo +nightly-2025-02-14 rplor
RPL_PATS=/path/to/RPL/docs/patterns-pest cargo +nightly-2025-02-14 rpl -- -Zinline-mir=false
You can also store the environment variable
RPL_PATSfor convenience.Without setting
RPL_PATS, built-in RPL pattern definitions are used.TIP: You can view all available lints with
cargo rpl -- -W help. -
See this website for the RPL book (Work in progress).
Feel free to open an issue or contact us via email ([email protected]) if you have any questions.
See this document for contribution-related instructions.
This project is licensed under the MPL-2.0.