Skip to content

Sarthib7/StoryLint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StoryLint

IP compliance linting tool for Story Protocol integrations.

Overview

StoryLint is a comprehensive linting tool designed to help developers build compliant applications on Story Protocol. It detects common integration mistakes, suggests best practices, and can automatically fix certain issues.

Phase 1 Status (Days 1-5)

Current Progress: Day 1 - Project Initialization

Features (Planned for Phase 1)

  • ✅ Monorepo structure with TypeScript
  • 🔄 CLI tool with 4 commands (analyze, generate, test, validate-pil)
  • 🔄 5 core linting rules:
    • story/ip-asset-registered - Ensures IP assets are registered before operations
    • story/error-handler-missing - Checks for proper error handling
    • story/no-hardcoded-addresses - Prevents hardcoded addresses
    • story/rpc-url-validated - Validates RPC configuration
    • story/license-attached - Ensures licenses are properly attached
  • 🔄 AST-based code analysis
  • 🔄 Human-readable and JSON output formats
  • 🔄 Jest testing infrastructure

Project Structure

storylint/
├── packages/
│   ├── core/           # Rule engine and AST parser
│   ├── cli/            # Command-line interface
│   └── vscode/         # VS Code extension (Phase 2)
├── test-files/         # Sample files for testing
└── .storylintrc.json   # Configuration file

Installation (After Phase 1)

npm install -g storylint

Usage (After Phase 1)

# Analyze your code
storylint analyze ./src

# With configuration file
storylint analyze ./src --config .storylintrc.json

# JSON output for CI/CD
storylint analyze ./src --format json

# Fail on errors (useful for CI)
storylint analyze ./src --fail-on-error

Development

# Install dependencies
npm install

# Build all packages
npm run build

# Run tests
npm test

# Development mode
npm run lint

Configuration

Create a .storylintrc.json file in your project root:

{
  "version": "1.0",
  "network": "mainnet",
  "rpcProvider": "https://mainnet.storyrpc.io",
  "rules": {
    "story/ip-asset-registered": "error",
    "story/error-handler-missing": "error",
    "story/no-hardcoded-addresses": "error",
    "story/rpc-url-validated": "error",
    "story/license-attached": "warning"
  },
  "autoFix": false
}

Roadmap

  • Phase 1 (Days 1-5): Core CLI tool and 5 linting rules
  • Phase 2 (Days 6-10): Code generation and VS Code extension
  • Phase 3 (Days 11-15): Advanced features and autofix

Contributing

This project is currently in Phase 1 development.

License

MIT

About

IP Compliance Scanner for Story Protocol

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •