analyse

Run static analysis on Python files with ruff, ty, complexipy, and semgrep.

Updated Sep 9, 2024
One-click install
npx skills add https://github.com/axel-kaliff/dotfiles --skill analyse-axel-kaliff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: analyse
Source: https://github.com/axel-kaliff/dotfiles/tree/main/claude/.claude/skills/analyse
Command: npx skills add https://github.com/axel-kaliff/dotfiles --skill analyse-axel-kaliff

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It provides a single, deterministic way to run multiple static-analysis tools across Python files and surface linting, type, complexity, and forbidden-pattern issues so developers can catch regressions and style violations before committing.

Core Features & Use Cases

  • Runs ruff, ty (type checking), complexipy (cognitive complexity), and a semgrep-based forbidden-patterns check in parallel and collates results into one scorecard.
  • Cascading target discovery: uncommitted changes, staged files, branch diffs versus main/master, and finally a full-repo fallback; includes an optional branch-level logic regression check that compares old vs new function behavior.
  • Use cases: pre-commit quality gate, PR review scans for behavioral regressions, and periodic repository health checks.

Quick Start

Run analyse on the current branch to scan changed Python files and produce a deterministic scorecard with detailed findings.

Frequently Asked Questions about analyse

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run Python static analysis on only changed files before committing?

Python static analysis can target changed files by cascading through uncommitted changes, staged files, or branch diffs against main/master, falling back to a full-repo scan when no changes are detected.

What's the best way to combine ruff, semgrep, and type checking into one scorecard?

Combining ruff, semgrep, ty, and complexipy into one scorecard is done by running these tools in parallel and collating linting, type, cognitive complexity, and forbidden-pattern findings into a single deterministic report.

Can I detect logic regressions in a Python branch diff automatically?

Logic regressions in a Python branch diff can be detected using an optional branch-level check that compares old versus new function behavior during the static analysis scan.

How does cognitive complexity analysis work for Python code?

Cognitive complexity analysis for Python code is performed by integrating complexipy, which evaluates how difficult functions are to understand, and surfaces these metrics alongside linting and type violations.

Does this static analysis tool require any external dependencies to run?

No external dependencies are required to run the static analysis, as it orchestrates ruff, ty, complexipy, and semgrep internally with a grep fallback to produce deterministic results.