← 返回
未分类 中文

featurelint

Statically analyze code for feature flag hygiene issues like stale flags, SDK misuse, safety risks, and architecture problems before production deployment.
在生产部署前,静态分析代码,检测陈旧标志、SDK误用、安全风险和架构问题等特征标志卫生问题。
suhteevah suhteevah 来源
未分类 clawhub v1.0.1 1 版本 100000 Key: 无需
★ 0
Stars
📥 361
下载
💾 0
安装
1
版本
#latest

概述

FeatureLint

> Feature flag hygiene analyzer that catches stale flags, SDK misuse, safety risks, and architecture problems before they reach production.

Emoji: flag

Homepage: https://featurelint.pages.dev

Product: featurelint

Accent: #e84393


What It Does

FeatureLint statically analyzes your codebase for feature flag hygiene issues across six categories:

  • Stale Flags (SF) — Detects hardcoded booleans, TODO-annotated flags, commented-out conditionals, and flags with past date references
  • Flag Complexity (FC) — Finds nested flag conditions, excessive branching, flag entanglement, and missing caching in loops
  • Flag Safety (FS) — Warns when flags gate authentication, payments, encryption, data deletion, or audit logging paths
  • SDK Misuse (SM) — Catches missing default values, loop evaluations, multiple SDK initializations, and missing error handling
  • Flag Lifecycle (FL) — Identifies flags without cleanup dates, abandoned experiments, 100% rollouts, and missing owner annotations
  • Flag Architecture (FA) — Detects wrong-layer evaluation, service coupling, missing registries, and leaked server-side state

90 total patterns with POSIX ERE regex matching, severity levels, and actionable recommendations.


Installation

As a Git Hook (Lefthook)

# lefthook.yml
pre-commit:
  commands:
    featurelint:
      glob: "*.{js,jsx,ts,tsx,py,rb,java,go,rs}"
      run: bash path/to/featurelint/scripts/dispatcher.sh staged --severity error

Direct CLI Usage

# Scan a directory
bash scripts/dispatcher.sh scan ./src

# Scan with JSON output
bash scripts/dispatcher.sh scan --format json --output report.json ./src

# Analyze staged files
bash scripts/dispatcher.sh staged

# Single file analysis
bash scripts/dispatcher.sh file ./src/flags.ts

# Health check
bash scripts/dispatcher.sh health

Tier System

TierPatternsCategoriesPrice
-----------------------------------------------------------------------
Free30Stale Flags + Flag Complexity$0
Pro60+ Flag Safety + SDK Misuse$9/month
Team90+ Flag Lifecycle + Flag Architecture$29/month

Activate a tier by setting your license key:

export FEATURELINT_LICENSE_KEY="FEATURELINT-XXXX-XXXX-XXXX-XXXX"

Commands

CommandDescription
------------------------------------------------------------------
scanAnalyze a directory for feature flag issues
fileAnalyze a single file
stagedAnalyze git staged files (for pre-commit hooks)
baselineCreate a baseline snapshot of current findings
compareCompare current findings against the baseline
healthRun self-diagnostic health check
versionPrint version information
helpShow usage and available options

Options

FlagDescriptionDefault
-------------------------------------------------------------------------------------
-f, --format Output format: text, json, csv, markdowntext
-o, --output Write report to file(stdout)
-s, --severity Minimum severity: error, warning, info, allall
-c, --category Filter by category codeall
-t, --tier License tier: free, pro, teamfree
-j, --jobs Parallel scan workers4
-i, --include Include files matching pattern(all)
-e, --exclude Exclude files matching pattern(none)
-C, --context Context lines around findings2
--scan-hiddenInclude hidden files and directoriesfalse
--warn-exitExit code 1 on warningsfalse
-v, --verboseIncrease verbosity (-vv for trace)0
-q, --quietSuppress non-essential outputfalse

Environment Variables

VariableDescription
--------------------------------------------------------------
FEATURELINT_LICENSE_KEYLicense key for tier activation
FEATURELINT_TIEROverride tier directly
FEATURELINT_FORMATDefault output format
FEATURELINT_SEVERITYDefault severity filter
FEATURELINT_JOBSDefault parallel job count

Output Formats

Text (default)

Human-readable terminal output with color-coded severity, file grouping, code context, and actionable fix recommendations.

JSON

Structured output for CI/CD integration. Includes metadata, summary counters, and a findings array with file, line, severity, check ID, description, and recommendation.

CSV

Spreadsheet-compatible output for tracking and reporting. One row per finding with all fields.

Markdown

Report template with summary tables, category breakdown, severity distribution, and a findings table. Uses the report.md.tmpl template when available.


Supported Languages

JavaScript, TypeScript, Python, Ruby, Java, Kotlin, Scala, Go, Rust, C#, F#, PHP, Swift, Dart, Vue, Svelte, Elixir, Clojure, Lua, R, YAML, JSON, TOML, XML, Terraform/HCL, and Shell.


Architecture

featurelint/
  scripts/
    dispatcher.sh    # CLI entry point and argument parsing
    analyzer.sh      # Core analysis engine and output formatters
    patterns.sh      # 90 patterns across 6 categories
    license.sh       # License validation and tier gating
  config/
    lefthook.yml     # Git hook configuration
  templates/
    report.md.tmpl   # Markdown report template
  SKILL.md           # This file

Examples

CI/CD Integration (GitHub Actions)

- name: FeatureLint
  run: |
    bash featurelint/scripts/dispatcher.sh scan \
      --format json \
      --output featurelint-report.json \
      --severity warning \
      ./src

Baseline Workflow

# Create initial baseline
bash scripts/dispatcher.sh baseline ./src

# After making changes, compare
bash scripts/dispatcher.sh compare ./src

Pre-commit with Error-Only Blocking

bash scripts/dispatcher.sh staged --severity error

Requirements

  • Bash 4.0 or later
  • Standard POSIX utilities: grep, sed, awk, find, sort, uniq, wc, cut
  • Optional: curl (for online license validation), git (for staged analysis)

License

Commercial software. Free tier available with 30 patterns.

See https://featurelint.pages.dev for pricing and terms.

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-05-07 14:53 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 76 📥 182,446
it-ops-security

DepGuard

suhteevah
使用原生包管理器审计扫描项目依赖的漏洞和许可证合规性,并生成安全或合规报告。
★ 0 📥 1,251
dev-programming

Mcporter

steipete
使用 mcporter CLI 直接列出、配置、认证及调用 MCP 服务器/工具(支持 HTTP 或 stdio),涵盖临时服务器、配置编辑及 CLI/类型生成功能。
★ 196 📥 67,957