Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Configuration

All configuration options for the GitHub Action and local CLI.

Action Inputs

InputDescriptionRequiredDefault
modeReview mode: single or bulkYes
lectures-pathPath to lectures directoryNolectures/
anthropic-api-keyAnthropic API key for Claude Sonnet 4.5Yes
github-tokenGitHub token for PR creationYes
comment-bodyIssue comment body (for single mode)No
llm-modelSpecific Claude model to useNoclaude-sonnet-4-5-20250929
rule-categoriesComma-separated categories to checkNoAll categories
create-prWhether to create PR with fixesNotrue
temperatureLLM temperatureNo1

LLM Model

The action uses Claude Sonnet 4.5 (claude-sonnet-4-5-20250929) with extended thinking:

Rule Types

The style guide uses a three-tier type system:

rule — Actionable ✅

Clearly actionable rules that are automatically applied. These are mechanical, objective checks (32 rules):

style — Advisory 💡

Subjective guidelines that require human judgment (13 rules):

migrate — Code Modernization 🔄

Legacy patterns that should be updated (4 rules, JAX and code categories only):

rule types are automatically applied. style and migrate types are reported as suggestions.

Sequential Category Processing

The action processes categories one at a time, feeding the updated document from each category into the next:

  1. Category 1 (e.g., Writing): Reviews original document → finds violations → applies fixes → updated document

  2. Category 2 (e.g., Math): Reviews updated document → finds violations → applies fixes → updated document

  3. Continue for all requested categories...

This ensures:

Trade-off: Sequential processing is slower than parallel (8 sequential API calls vs 8 parallel), but produces more reliable results.

Review Modes

Single Mode

Reviews a single lecture file. Triggered by issue comments:

@qe-style-checker lecture_name
@qe-style-checker lecture_name writing,math

Bulk Mode

Reviews all lectures in the lectures-path directory. Typically used with scheduled workflows:

- uses: QuantEcon/action-style-guide@v0.7
  with:
    mode: 'bulk'
    lectures-path: 'lectures/'

PR Creation

When create-pr is true (default), the action:

  1. Creates a new branch: style-guide/{lecture}-{timestamp}

  2. Commits all applied fixes with detailed messages

  3. Opens a PR with:

    • Summary of all changes by category

    • Style suggestions as a PR comment

    • Labels: automated, style-guide, review