Expand description
CukeDedup’s reusable static-analysis library.
The CLI is the primary integration for repository-wide analysis. Embedders can also parse definitions and feature steps into the shared representation and run the same rules directly:
use cuke_dedup::analysis::analyze;
use cuke_dedup::config::{Config, ConfigOverrides};
use cuke_dedup::gherkin;
use cuke_dedup::source_adapter::{SourceFile, SourceLanguage};
use cuke_dedup::typescript;
use std::path::Path;
let root = std::env::current_dir()?;
let config = Config::load(&root, ConfigOverrides::default())?;
let definition_file = SourceFile {
path: root.join("steps.ts"),
language: SourceLanguage::TypeScript,
};
let definitions = typescript::extract(
r#"import { Given } from "@cucumber/cucumber";
Given("a user exists", async () => { await createUser(); });"#,
&definition_file,
)?;
let feature_steps = gherkin::extract(
"Feature: Users\n Scenario: Existing user\n Given a user exists\n",
Path::new("features/users.feature"),
)?;
let result = analyze(definitions, feature_steps, &config)?;
assert!(result.findings.is_empty());Modules§
- analysis
- Rule evaluation over the shared step-definition representation.
- cli
- Command-line parsing and analysis orchestration.
- config
- Configuration loading and precedence.
- discovery
- Gitignore-aware repository discovery.
- gherkin
- Full-syntax, localized Gherkin feature-step extraction.
- model
- Shared intermediate representation and diagnostics.
- modes
- Changed-files and existing-findings baseline modes for incremental CI adoption.
- reporters
- Terminal, JSON, JSON Lines, self-contained HTML, and SARIF reporters.
- source_
adapter - Definition-source adapter contracts and extension-based routing.
- typescript
- Tree-sitter based JavaScript and TypeScript step-definition extraction.