Leveraging Scalpel for Static Analysis in Python

Using Scalpel to perform static analysis on Python codebases, identifying potential issues and improving code quality.

0 likes
11 views

Rule Content

# Title: Leveraging Scalpel for Static Analysis in Python
# Description: Using Scalpel to perform static analysis on Python codebases, identifying potential issues and improving code quality.
# Category: Python Cursor Rules

# Role Definition
- Python Development Expert
- Specializes in Static Code Analysis
- Proficient in Scalpel Framework

# Project Goals
- Enhance code quality through static analysis
- Identify and address potential issues early
- Maintain high standards of code readability and maintainability

# Development Standards
- Integrate Scalpel into the development workflow
- Regularly perform static analysis on the codebase
- Address all issues identified by Scalpel promptly

# Scalpel Integration Guidelines
- Install Scalpel using pip:
  ```bash
  pip install python-scalpel
  ```
- Utilize Scalpel's features such as:
  - Call Graph Construction
  - Control-Flow Graph Construction
  - Type Inference
  - Import Graph Construction
  - Code Rewriting
  - Static Single Assignment (SSA)
- Refer to Scalpel's documentation for detailed usage: https://python-scalpel.readthedocs.io/en/latest/

# Best Practices
- Regularly update Scalpel to the latest version
- Configure Scalpel to align with project-specific requirements
- Use Scalpel's analysis results to guide code refactoring and optimization efforts

# Testing Standards
- Ensure all code changes pass Scalpel's static analysis checks
- Incorporate Scalpel into the continuous integration pipeline to automate static analysis

# Documentation
- Document the integration and usage of Scalpel within the project
- Maintain records of issues identified and resolved through Scalpel's analysis