Whitelist & Ignore Patterns

Control which files and code patterns Vibesweep analyzes with flexible inclusion and exclusion rules.

Ignore Patterns

Basic File Exclusion

In .vibesweeprc.json:

{
  "ignore": [
    "node_modules/**",
    "dist/**",
    "build/**",
    "*.min.js",
    "**/*.test.js",
    "**/__tests__/**"
  ]
}

Using .vibesweepignore

Create a .vibesweepignore file (similar to .gitignore):

# Dependencies
node_modules/
bower_components/

# Build outputs
dist/
build/
out/
.next/

# Test files
*.test.js
*.spec.ts
__tests__/
__mocks__/

# Generated files
*.generated.ts
schema.graphql

# Vendor files
vendor/
third-party/

Pattern Syntax

Vibesweep supports glob patterns:

  • * - Match any characters except /
  • ** - Match any characters including /
  • ? - Match single character
  • [abc] - Match any character in brackets
  • !(pattern) - Negate pattern
  • {a,b} - Match either a or b

Examples:

{
  "ignore": [
    "**/*.min.js",        // All minified JS files
    "src/**/test-*.js",   // Test files in src
    "!src/test-utils.js", // But include test-utils
    "*.{tmp,temp,bak}",   // Temporary files
    "docs/**/*.md"        // All markdown in docs
  ]
}

Whitelist Patterns

Code Pattern Whitelisting

Keep specific patterns from being flagged:

{
  "whitelist": {
    "variables": [
      "DEBUG_*",      // Keep all DEBUG_ prefixed vars
      "process.env.*" // Keep all env vars
    ],
    "functions": [
      "test*",        // Keep test functions
      "mock*",        // Keep mock functions
      "__*"           // Keep private functions
    ],
    "imports": [
      "react",        // Always keep React import
      "@testing-library/*" // Keep testing imports
    ]
  }
}

Dead Code Whitelisting

Prevent false positives for framework code:

{
  "deadCode": {
    "whitelist": [
      {
        "pattern": "export default function handler",
        "reason": "Next.js API routes"
      },
      {
        "pattern": "getStaticProps|getServerSideProps",
        "reason": "Next.js page functions"
      },
      {
        "pattern": "__esModule",
        "reason": "TypeScript compiled output"
      }
    ]
  }
}

AI Pattern Whitelisting

Exclude known good AI-generated code:

{
  "aiPatterns": {
    "whitelist": [
      {
        "file": "src/utils/helpers.js",
        "reason": "Reviewed and approved AI code"
      },
      {
        "pattern": "// AI-APPROVED:",
        "reason": "Manually reviewed AI code"
      }
    ]
  }
}

Advanced Configuration

Per-Language Settings

Different rules for different file types:

{
  "languages": {
    "javascript": {
      "ignore": ["*.min.js", "vendor/**"]
    },
    "typescript": {
      "ignore": ["*.d.ts", "generated/**"]
    },
    "python": {
      "ignore": ["__pycache__/**", "*.pyc"]
    }
  }
}

Directory-Specific Rules

Create .vibesweeprc.json in subdirectories:

// frontend/.vibesweeprc.json
{
  "extends": "../.vibesweeprc.json",
  "ignore": ["public/vendor/**"],
  "whitelist": {
    "imports": ["@mui/*", "styled-components"]
  }
}

Dynamic Patterns

Use environment variables:

{
  "ignore": [
    "${GENERATED_DIR}/**",
    "build-${NODE_ENV}/**"
  ]
}

Common Patterns

Frontend Projects

{
  "ignore": [
    "public/vendor/**",
    "**/*.min.{js,css}",
    "build/**",
    ".cache/**",
    "coverage/**"
  ]
}

Backend Projects

{
  "ignore": [
    "logs/**",
    "tmp/**",
    "uploads/**",
    "**/*.log",
    "migrations/*.sql"
  ]
}

Monorepo Setup

{
  "ignore": [
    "packages/*/node_modules/**",
    "packages/*/dist/**",
    "lerna-debug.log"
  ],
  "whitelist": {
    "imports": ["@company/*"]
  }
}

CLI Override

Override config file patterns via CLI:

# Include normally ignored files
vibesweep analyze . --no-ignore

# Add additional ignore patterns
vibesweep analyze . --ignore "temp/**,*.bak"

# Force include specific patterns
vibesweep analyze . --include "dist/**" --no-default-ignore

Best Practices

  1. Start Conservative: Begin with minimal ignores, add as needed
  2. Document Reasons: Comment why patterns are ignored
  3. Review Regularly: Audit whitelist patterns quarterly
  4. Use Specific Patterns: Avoid overly broad patterns like **/*
  5. Version Control: Commit .vibesweepignore and config files

Debugging Patterns

See which files are included/excluded:

# Show all files that would be analyzed
vibesweep analyze . --list-files

# Debug why a file is ignored
vibesweep analyze . --verbose --explain src/utils.js

Related