How anonymoose725/pylon works
Pylon is a Python static-analysis CLI. Its main workflow discovers Python files, runs registered AST-based rules, and prints findings; with --explain, it adds surrounding source context and asks a selected LLM provider for a judgment. The graph preserves the implemented rule set and provider integrations documented in the README. Evidence is strongest for the CLI, several rules, and Ollama; some provider and rule implementations were not excerpted, so uncertain internal dispatch details are omitted.
Main entry points: registry.py Rule registry · cli.py File scan and report · explain.py Finding explanation · ollama_provider.py Ollama provider
Components 17
CLI workflow
- File scan and report
src/pylon_analyzer/cli.py
Static rules
- Rule registry
src/pylon_analyzer/rules/registry.py - Bare excepts
src/pylon_analyzer/rules/bare_excepts.py - Unused imports
src/pylon_analyzer/rules/unused_imports.py - Mutable defaults
src/pylon_analyzer/rules/mutable_default_args.py - Wildcard imports
src/pylon_analyzer/rules/wildcard_imports.py - Constant comparisons
src/pylon_analyzer/rules/improper_compare_keyword_const.py - Shadowed definitions
src/pylon_analyzer/rules/shadowed_functions.py - Shadowed builtins
src/pylon_analyzer/rules/shadowed_builtins.py
Finding model
- Finding schema
src/pylon_analyzer/rules/base.py
LLM explanations
- Finding explanation
src/pylon_analyzer/ai/explain.py - Provider interface
src/pylon_analyzer/ai/providers/base.py - Ollama provider
src/pylon_analyzer/ai/providers/ollama_provider.py - Other providers
src/pylon_analyzer/ai/providers
Other components
- CLI user
- Ollama service
- Hosted LLM services
Connections 16
- CLI user → File scan and report: runs
src/pylon_analyzer/cli.py - File scan and report → Rule registry: loads rules
src/pylon_analyzer/cli.py - Rule registry → Bare excepts: registers
src/pylon_analyzer/rules/registry.py - Rule registry → Unused imports: registers
src/pylon_analyzer/rules/registry.py - Rule registry → Mutable defaults: registers
src/pylon_analyzer/rules/registry.py - Rule registry → Wildcard imports: registers
src/pylon_analyzer/rules/registry.py - Rule registry → Constant comparisons: registers
src/pylon_analyzer/rules/registry.py - Rule registry → Shadowed definitions: registers
src/pylon_analyzer/rules/registry.py - Rule registry → Shadowed builtins: registers
src/pylon_analyzer/rules/registry.py - File scan and report → Finding schema: collects findings
src/pylon_analyzer/cli.py - File scan and report → Finding explanation: requests explanation
src/pylon_analyzer/cli.py - Finding explanation → Provider interface: calls completion
src/pylon_analyzer/ai/explain.py - File scan and report → Ollama provider: selects provider
- File scan and report → Other providers: selects provider
src/pylon_analyzer/cli.py - Ollama provider → Ollama service: sends prompt
src/pylon_analyzer/ai/providers/ollama_provider.py - Other providers → Hosted LLM services: sends prompts
README.md