pawnlint

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: MIT

README

pawnlint

Static analysis and linting for Pawn v3 (SA-MP and open.mp).

pawnlint parses with pawn-parser. The Pawn compiler is still the source of truth for compilation.

Features

  • Syntax, semantic, control-flow, and include-graph analysis
  • 115 built-in rules across analysis, performance, API, and policy categories
  • Safe automatic fixes, inline suppressions, baselines, and incremental caching
  • Text, JSON, JSONL, SARIF, and GitHub Actions output
  • Stdin support for tool and CI integration

Install

go install github.com/pawnkit/pawnlint/cmd/pawnlint@latest

Usage

pawnlint gamemodes/main.pwn
pawnlint gamemodes/
pawnlint --format json gamemodes/
pawnlint --diff gamemodes/
pawnlint --fix gamemodes/
cat main.pwn | pawnlint --stdin --stdin-filename main.pwn

The default profile is recommended. Use --profile strict for more checks.

Command Purpose
pawnlint --list-rules List every rule.
pawnlint --explain rule-id Show a rule's full explanation.
pawnlint --init-config Write a default pawnlint.toml.
pawnlint --enable id --disable id paths... Toggle specific rules.
pawnlint --format text|compact|json|jsonl|sarif|github paths... Choose output format.
pawnlint --diff paths... Preview available fixes.
pawnlint --fix-safe paths... Apply only machine-safe fixes.
pawnlint --generate-baseline paths... Replace the configured baseline.
pawnlint --prune-baseline paths... Remove resolved baseline entries.
pawnlint --timings paths... Print stage and per-rule durations.

Exit codes

Code Meaning
0 No finding reached the failure threshold.
1 A finding reached the failure threshold, or --diff found changes.
2 Invalid arguments or configuration.
3 Project analysis failed.

Errors fail by default. Warnings fail too when warnings-as-errors = true.

Documentation

Directories

Path Synopsis
cmd
genapimetadata command
genruledocs command
pawnlint command
realworldstats command
internal
api
cli
Package cli implements the pawnlint command.
Package cli implements the pawnlint command.
fix
source/walk
Package walk provides traversal and query helpers over the pawn-parser CST, including a cached index of nodes by Kind.
Package walk provides traversal and query helpers over the pawn-parser CST, including a cached index of nodes by Kind.
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL