Files
foxhunt/clippy.toml
jgrusewski ea9d8f2c88 🚨 ARCHITECTURAL DISASTER: THREE Competing Type Sources Discovered
## Critical Investigation Results

**DISASTER CONFIRMED**: Agents discovered THREE type sources instead of ONE:
1. foxhunt-common-types/ (SHOULD NOT EXIST - still active!)
2. trading_engine/src/types/ (massive duplication)
3. common/src/types.rs (depends on competing crate)

## Evidence of Violations
- foxhunt-common-types still in workspace members (line 86)
- common/Cargo.toml depends on foxhunt-common-types (line 48)
- 48+ duplicate type definitions across OrderSide, OrderStatus, OrderType
- Compilation failures due to competing imports

## Immediate Action Required
- Choose ONE canonical source
- DELETE foxhunt-common-types completely
- Consolidate ALL types to single source
- Fix THREE-WAY import chaos

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-26 15:33:34 +02:00

135 lines
5.8 KiB
TOML

# Clippy Configuration for Foxhunt HFT System
# TYPE GOVERNANCE ENFORCEMENT
# =============================================================================
# 🚨 TYPE GOVERNANCE LINTS - CRITICAL FOR SYSTEM INTEGRITY
# =============================================================================
# Deny any attempt to create duplicate type definitions
# This prevents the primary architectural issue
avoid-breaking-exported-api = true
allow-expect-in-tests = true
allow-unwrap-in-tests = true
# =============================================================================
# 🔒 FORBIDDEN PATTERNS THAT VIOLATE TYPE GOVERNANCE
# =============================================================================
# These patterns indicate type governance violations:
# 1. Duplicate enum definitions (especially trading types)
# 2. Unnecessary type aliases that shadow canonical types
# 3. Direct external library imports that bypass prelude
# 4. Local type redefinitions that conflict with canonical types
# Specific lints for common violations:
enum-variant-names = "allow" # Allow different naming for similar enums (we forbid the enums entirely)
module-inception = "deny" # Prevent confusing module structures
redundant-clone = "deny" # Performance impact
clone-on-ref-ptr = "deny" # Performance impact
# =============================================================================
# 🎯 PERFORMANCE AND SAFETY (HFT CRITICAL)
# =============================================================================
# Critical for HFT performance
boxed-local = "deny" # Prevents unnecessary heap allocation
vec-box = "deny" # Prevents double indirection
large-types-passed-by-value = "deny" # Forces efficient data passing
# Memory safety in high-frequency environment
mem-forget = "deny" # Prevents memory leaks
mem-replace-option-with-none = "deny"
option-option = "deny" # Prevents confusing nested Options
# =============================================================================
# 🧹 CODE QUALITY FOR SYSTEM RELIABILITY
# =============================================================================
# Consistency enforcement
inconsistent-struct-constructor = "deny"
manual-string-new = "deny"
string-add = "deny" # Use String::push_str instead
string-add-assign = "allow" # This is actually efficient
# Error handling (critical for trading system)
expect-used = "deny" # Force proper error handling
unwrap-used = "deny" # Force proper error handling
panic = "deny" # No panics in production code
unimplemented = "deny" # No incomplete implementations
unreachable = "deny" # No unreachable code paths
# =============================================================================
# 📊 DOCUMENTATION AND MAINTAINABILITY
# =============================================================================
# Ensure public APIs are documented
missing-docs-in-private-items = "allow" # Only require public docs
missing-safety-doc = "deny" # Safety docs required for unsafe
missing-panics-doc = "deny" # Document potential panics
# =============================================================================
# 🚫 SPECIFIC TYPE GOVERNANCE VIOLATIONS
# =============================================================================
# These patterns specifically indicate type governance issues:
# Prevent module naming that suggests type duplication
module-name-repetitions = "deny"
# Prevent wildcard imports that might hide type conflicts
# (Exception: we require prelude wildcard imports)
wildcard-imports = "allow" # Required for prelude pattern
# Prevent type complexity that leads to duplicate definitions
type-complexity = "deny"
too-many-arguments = "deny" # Forces better API design
# =============================================================================
# ⚡ HFT-SPECIFIC PERFORMANCE LINTS
# =============================================================================
# Critical path optimization
verbose-bit-mask = "deny" # Use more efficient bit operations
manual-saturating-arithmetic = "deny" # Use saturating_add/sub
cast-lossless = "deny" # Prefer From/Into for lossless conversions
# Lock-free programming support
mutex-atomic = "deny" # Prefer atomics where possible
rc-mutex = "deny" # Usually indicates design issue
# Memory allocation efficiency
needless-collect = "deny" # Avoid unnecessary collections
map-collect-result-unit = "deny" # Optimize iterator chains
# =============================================================================
# 🎛️ COMPLEXITY MANAGEMENT
# =============================================================================
# Prevent functions/types that are too complex (leads to duplication)
cognitive-complexity-threshold = 30
too-many-lines-threshold = 150
type-complexity-threshold = 250
# =============================================================================
# 🔧 DEVELOPER EXPERIENCE
# =============================================================================
# Make clippy output more helpful
verbose = true
explain = true
# =============================================================================
# 🏗️ BUILD AND CI INTEGRATION
# =============================================================================
# These settings ensure CI fails on type governance violations:
# - All "deny" lints will cause compilation failure
# - This enforces type governance automatically
# - No manual review needed for basic violations
# Custom lint groups for different validation phases:
# 1. type-governance: Core type system validation
# 2. hft-performance: High-frequency trading optimizations
# 3. system-reliability: Error handling and safety
# 4. code-quality: General maintainability