samp.directory
← Scripts y librerías

pawnkit/pawnlint

A linter for Pawn v3, used by SA-MP/open.mp

Herramienta★ 3actualizado hace 7 díasMITGo
Abrir en GitHub

README.md

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. Editor integrations can pass existing pawn-analysis results so equivalent semantic checks are not repeated.

Features

  • Syntax, semantic, control-flow, and include-graph analysis
  • 115 built-in rules across analysis, performance, API, and policy categories
  • 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. From a project directory, pawnlint uses the manifest entry and include paths when no file arguments are given.

CommandPurpose
pawnlint --list-rulesList every rule
pawnlint --explain rule-idExplain a rule
pawnlint --init-configWrite a default pawnlint.toml
pawnlint --check-configValidate config paths, entries, and includes
pawnlint --enable id --disable id paths...Toggle specific rules
pawnlint --format text|compact|json|jsonl|sarif|github paths...Choose an output format
pawnlint --diff paths...Preview available fixes
pawnlint --fix-safe paths...Apply 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 rule timings

Exit codes

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

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

Documentation

Contributing

New rules, false-positive fixes, and small Pawn examples are welcome. See CONTRIBUTING.md for tests and ownership boundaries.

linteropen-mpopenmppawnsamptool

Esta página se genera con lo que GitHub publica sobre el repositorio. samp.directory no aloja el código. Informar de un problema con esta ficha