Skip to main content
By default, Macroscope focuses on runtime correctness issues. Custom Rules adds a separate review pass focused on your team’s conventions, patterns, and best practices.
Custom Rules is in beta. Contact support@macroscope.com to enable it, then add a macroscope.md file to your repo.

Setup

Add a macroscope.md file to the root of your repo (or any folder you want rules to apply to). List your conventions and best practices in plain text. During code review, Macroscope will:
  1. Run a separate CheckRun focused on your rules
  2. Leave inline comments pointing to violations
  3. Reference the specific rule in each comment

Example macroscope.md

### Security
- NEVER use personally identifiable customer data in debug logs.
- File Systems should always be accessed using a rooted filesystem operation.

### Style
- Prefer inlining over temporary variables unless the value is mutated, expensive, or used multiple times.
- Errors should be if-scoped when all declared variables are used exclusively within that scope.

### Typos
Literal and formatted strings displayed to the user should be free of typos.

Folder-Level Rules

Create macroscope.md files in different folders for folder-specific rules (e.g. backend/macroscope.md and frontend/macroscope.md). Macroscope walks up the directory tree and merges rules from each macroscope.md it finds. To stop inheritance at a specific level, name that file macroscope_root.md.
repo/
├── macroscope.md                  # Repo-wide rules
├── backend/
│   ├── macroscope.md              # Backend-specific rules
│   └── service/
│       └── macroscope.md          # Service-specific rules
├── frontend/
│   └── macroscope.md              # Frontend-specific rules
└── scripts/
    └── macroscope_root.md         # Stops inheritance from parent folders