You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`Pine Script Validator` helps humans and coding agents inspect `.pine` files locally, catch syntax and semantic problems, and turn raw diagnostics into actionable debugging output. The project is built for workflows where an agent needs to read a Pine script, understand what failed, and decide what to fix next.
7
+
Static validator, audit CLI, and agent-debugging toolkit for TradingView Pine Script.
6
8
7
-
## What It Solves
9
+
`Pine Script Validator` helps humans and coding agents inspect `.pine` files locally, catch syntax and semantic issues early, and turn raw diagnostics into actionable debugging output. It is designed for real-world local workflows where an agent or developer needs to validate, interpret, and iterate on Pine code outside TradingView.
8
10
9
-
Debugging Pine Script outside TradingView is awkward, especially for automated workflows. Agents typically need:
11
+
Current metadata coverage and built-in validation are focused on Pine Script v6.
12
+
13
+
## Highlights
14
+
15
+
- Pure Python lexer and parser for Pine Script
16
+
- Validation of built-in functions and namespaces using bundled Pine Script v6 metadata
17
+
- Human-readable diagnostics with line and column locations
18
+
-`--json` output for tooling and automation
19
+
-`--agent-json` output with excerpts, pointers, suggestions, and next steps
20
+
- Severity ordering and filtering controls
21
+
- Batch validation for files, directories, and glob patterns
22
+
-`--sarif` output for CI and code scanning workflows
23
+
- Audit mode for large Pine corpora
24
+
25
+
## Why This Project Exists
26
+
27
+
Pine Script tooling outside TradingView is limited, especially for automated debugging workflows. Agents usually need:
10
28
11
29
- a local parser they can run repeatedly
12
30
- machine-readable diagnostics
@@ -15,29 +33,11 @@ Debugging Pine Script outside TradingView is awkward, especially for automated w
15
33
16
34
This project focuses on exactly that.
17
35
18
-
## Core Capabilities
19
-
20
-
- Parse Pine Script with a pure Python lexer and parser
21
-
- Validate built-in functions and namespaces using bundled Pine v6 metadata
22
-
- Report syntax, semantic, warning, and hint diagnostics with source positions
23
-
- Emit standard JSON diagnostics for tooling integration
24
-
- Emit agent-oriented JSON reports with:
25
-
- per-diagnostic line excerpts
26
-
- visual pointers to the failing span
27
-
- suggested remediation guidance
28
-
- summary counts and next-step hints
29
-
- Validate multiple files or directories in one command
30
-
- Emit SARIF output for CI pipelines, review bots, and code scanning tools
31
-
- Audit large script corpora and generate JSON and Markdown reports
32
-
- Control which severities are emitted with professional CLI toggles
33
-
34
-
## Best Fit Use Cases
35
-
36
-
- letting agents debug Pine scripts inside local coding workflows
37
-
- validating generated Pine code before shipping it elsewhere
38
-
- regression testing parser support against real-world scripts
39
-
- scanning Pine corpora to find unsupported syntax patterns
40
-
- building higher-level Pine tooling on top of Python
36
+
## Pine Version
37
+
38
+
This project currently targets Pine Script v6 for built-in metadata coverage, namespace validation, and most real-world compatibility expectations.
39
+
40
+
If a script relies on older undocumented behavior or version-specific quirks outside the current validator rules, additional parser or semantic support may still be needed.
-`--agent-json` for richer debugging output intended for agents and automation
168
160
- directory and multi-file batch validation
169
161
-`--sarif` for CI, code scanning, and external review integrations
170
-
-`--errors/--no-errors`
171
-
-`--warnings/--no-warnings`
172
-
-`--information/--no-information`
173
-
-`--hints/--no-hints`
174
-
175
-
Diagnostics are ordered by severity first, then by source location. By default the CLI prints errors first, then warnings, then information messages, and finally hints.
176
162
177
163
Exit codes:
178
164
@@ -183,15 +169,8 @@ Exit codes:
183
169
184
170
The audit command scans one or more script roots, compares observed Pine usage against bundled metadata and local documentation, and writes report files for broader maintenance work.
0 commit comments