Polyglot AST subtree DRY analyzer. A Rust port of unclebob/dry4go, extended to Rust, JavaScript, TypeScript, and Python.
Project description
drywall
Polyglot AST subtree DRY analyzer. Detects duplicate code across files using Jaccard similarity over normalized AST fingerprints.
A Rust port of unclebob/dry4go, extended to work across Rust, JavaScript, TypeScript, and Python (dry4go is Go-only).
Install
# Rust
cargo install drywall
# Python
pip install drywall
# or, without installing:
uvx drywall ./src
# Node.js
npm install --save-dev drywall-cli
# then: npx drywall ./src, or add a package.json script
Or download the binary for your platform from the latest release:
| Platform | Binary |
|---|---|
| Linux x86_64 | drywall-linux-x86_64 |
| macOS Apple Silicon | drywall-macos-aarch64 |
| macOS Intel | drywall-macos-x86_64 |
# Linux
curl -sL https://github.com/gabadi/drywall/releases/latest/download/drywall-linux-x86_64 -o drywall
chmod +x ./drywall
# macOS Apple Silicon
curl -sL https://github.com/gabadi/drywall/releases/latest/download/drywall-macos-aarch64 -o drywall
chmod +x ./drywall
# macOS Intel
curl -sL https://github.com/gabadi/drywall/releases/latest/download/drywall-macos-x86_64 -o drywall
chmod +x ./drywall
The Linux binary is statically linked (musl) — no runtime dependencies.
Usage
drywall [--threshold 0.82] ./src
--threshold is the Jaccard similarity cutoff (default 0.82, same as dry4go). Pairs at or above the threshold are reported. Exit codes: 0 = no duplicates, 1 = duplicates found, 2 = bad arguments.
Use as a CI gate
Add to any project's CI pipeline:
- name: Install drywall
run: |
curl -sL https://github.com/gabadi/drywall/releases/latest/download/drywall-linux-x86_64 -o drywall
chmod +x ./drywall
- name: DRY check
run: ./drywall --threshold 0.82 ./src
--threshold sets the Jaccard similarity cutoff (default 0.82). Pairs at or above the threshold are flagged. The step fails (exit 1) if any duplicates are found.
Build from source
Requires Rust 1.96+:
cargo build --release
./target/release/drywall ./src
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file drywall-0.1.3-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl.
File metadata
- Download URL: drywall-0.1.3-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl
- Upload date:
- Size: 2.1 MB
- Tags: Python 3, manylinux: glibc 2.5+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67c6bc7bf33f9ce0121b6f06b2348f92a8f5f15d714e9fa2bede84dab4b3bfc7
|
|
| MD5 |
d089e370e2493f1411bf778398846f21
|
|
| BLAKE2b-256 |
eda5930c33fb2e60581f9ce4debf84b46898de3da3dc985080660f366e91819b
|
Provenance
The following attestation bundles were made for drywall-0.1.3-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl:
Publisher:
release.yml on gabadi/drywall
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
drywall-0.1.3-py3-none-manylinux_2_5_x86_64.manylinux1_x86_64.whl -
Subject digest:
67c6bc7bf33f9ce0121b6f06b2348f92a8f5f15d714e9fa2bede84dab4b3bfc7 - Sigstore transparency entry: 2076628537
- Sigstore integration time:
-
Permalink:
gabadi/drywall@7cf4a59db58d1ed8aa43a8cdec628174dfee1d14 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/gabadi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7cf4a59db58d1ed8aa43a8cdec628174dfee1d14 -
Trigger Event:
push
-
Statement type:
File details
Details for the file drywall-0.1.3-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: drywall-0.1.3-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.9 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41085eea046f68606fd65e742b8e696c858fd8af58f0fa4ee6b89535293bf803
|
|
| MD5 |
da7fc8fa339d8171d03234b67c739ff1
|
|
| BLAKE2b-256 |
a4aae40a0660d84b1eaa60f242a11ecc0d0661e1ce4ecd474160c17c4c12be7c
|
Provenance
The following attestation bundles were made for drywall-0.1.3-py3-none-macosx_11_0_arm64.whl:
Publisher:
release.yml on gabadi/drywall
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
drywall-0.1.3-py3-none-macosx_11_0_arm64.whl -
Subject digest:
41085eea046f68606fd65e742b8e696c858fd8af58f0fa4ee6b89535293bf803 - Sigstore transparency entry: 2076628480
- Sigstore integration time:
-
Permalink:
gabadi/drywall@7cf4a59db58d1ed8aa43a8cdec628174dfee1d14 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/gabadi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7cf4a59db58d1ed8aa43a8cdec628174dfee1d14 -
Trigger Event:
push
-
Statement type:
File details
Details for the file drywall-0.1.3-py3-none-macosx_10_12_x86_64.whl.
File metadata
- Download URL: drywall-0.1.3-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.9 MB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64061ce86f2108d364ad1937ccf9e7d055233bc67ef8d41b45c6083d02ea04d9
|
|
| MD5 |
281d0108cd41722767e8c546ebaa28ef
|
|
| BLAKE2b-256 |
dd7b18e67b7622cd8c0ebdd0455b9192dc1e8292623982f8a51376aa27888a9d
|
Provenance
The following attestation bundles were made for drywall-0.1.3-py3-none-macosx_10_12_x86_64.whl:
Publisher:
release.yml on gabadi/drywall
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
drywall-0.1.3-py3-none-macosx_10_12_x86_64.whl -
Subject digest:
64061ce86f2108d364ad1937ccf9e7d055233bc67ef8d41b45c6083d02ea04d9 - Sigstore transparency entry: 2076628418
- Sigstore integration time:
-
Permalink:
gabadi/drywall@7cf4a59db58d1ed8aa43a8cdec628174dfee1d14 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/gabadi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7cf4a59db58d1ed8aa43a8cdec628174dfee1d14 -
Trigger Event:
push
-
Statement type: