Skip to content

Instantly share code, notes, and snippets.

@compwron
Created April 8, 2026 23:28
Show Gist options
  • Select an option

  • Save compwron/bd4c620602671c242ecc42c955255b28 to your computer and use it in GitHub Desktop.

Select an option

Save compwron/bd4c620602671c242ecc42c955255b28 to your computer and use it in GitHub Desktop.
team-lint-audit: Find all lint issues owned by a specific team (ESLint suppressions, RuboCop todo, inline disables)
name team-lint-audit
description Find all lint issues (ESLint suppressions, RuboCop todo entries, inline rubocop:disable comments) owned by a specific team. Use when user says "find lint issues owned by", "lint audit for team", "team lint debt", or wants to see lint suppressions for a team like Cat Crew.

Team Lint Audit

Find and summarize all lint issues owned by a given team in the app-workflow repo.

Inputs

The user provides a team name (e.g. "Cat Crew"). Derive the kebab-case slug (e.g. cat-crew) for matching in ownership files.

Step 1: Build Owned-Paths Set

Collect all file paths and directory prefixes owned by the team. Store this as OWNED_PATHS — every later step filters against it.

1a. CODEOWNERS

Use Grep to search .github/CODEOWNERS for lines containing the team slug (e.g. cat-crew). CODEOWNERS entries are glob patterns (e.g. /app/controllers/app/dme_orders/*). For each matching line, extract the glob pattern (first column) and expand it using Glob to get concrete file paths. Add all matched paths to OWNED_PATHS.

1b. Distributed .codeowner files

Use Glob to find all .codeowner files: pattern **/.codeowner. Read each file and check if it contains the team slug. When it does, the parent directory of that .codeowner file is team-owned — add that directory prefix to OWNED_PATHS.

Result

You now have a set of concrete file paths and directory prefixes. A file belongs to the team if it matches any path in OWNED_PATHS or is under any directory prefix in OWNED_PATHS.

Step 2: ESLint Suppressions

Read linters/eslint/eslint-suppressions.json. Inspect its structure (it may be keyed by file path or by rule — check before assuming).

For each file path in the suppressions data, check if it falls under any entry in OWNED_PATHS. Collect all matching entries.

Group results by rule name. For each rule, list affected files and violation counts.

Step 3: RuboCop Todo

Read .rubocop_todo.yml. Each cop entry has an Exclude list of file paths.

For each excluded file path, check if it falls under any entry in OWNED_PATHS. Collect all matching entries.

Group by cop name with file counts.

Step 4: Inline rubocop:disable

Use Grep to search for rubocop:disable in *.rb files, scoped to the directory prefixes in OWNED_PATHS. Exclude lines that also contain rubocop:enable (those are block closers, not suppressions).

Group by cop name with file and line references.

Step 5: Report

Present a summary table followed by details:

## {Team Name} Lint Issues — N total

### ESLint Suppressions (X entries, Y files)

| Rule | Files | Violations |
|---|---|---|
| rule-name | N | M |

### RuboCop Todo (X entries, Y files)

| Rule | Count | Notes |
|---|---|---|
| Cop/Name | N | Brief context |

### Inline rubocop:disable (X comments, Y files)

| Rule | Count | Where |
|---|---|---|
| Cop/Name | N | Brief location summary |

### Top Problem Areas

1. Biggest issue and where it concentrates
2. Second biggest
3. Third biggest

Key File Locations

  • ESLint suppressions: linters/eslint/eslint-suppressions.json
  • RuboCop todo: .rubocop_todo.yml
  • CODEOWNERS: .github/CODEOWNERS
  • Distributed ownership: **/.codeowner files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment