Module: Yard::Lint::Validators::Warnings::SyntaxError
- Defined in:
- lib/yard/lint/validators/warnings/syntax_error.rb,
lib/yard/lint/validators/warnings/syntax_error/config.rb,
lib/yard/lint/validators/warnings/syntax_error/parser.rb,
lib/yard/lint/validators/warnings/syntax_error/result.rb,
lib/yard/lint/validators/warnings/syntax_error/validator.rb
Overview
SyntaxError validator
Flags Ruby files that YARD could not parse because of a syntax error.
Such files are silently skipped by YARD - they contribute no objects and
therefore no documentation offenses - so without this validator a run
could pass (exit 0) over code that does not even parse. This validator
surfaces the parser error as an offense (severity error by default),
making the run exit non-zero. Enabled by default.
For example, a file whose method signature is missing its closing
parenthesis (def foo(x followed by a body and end) fails to parse;
YARD reports Syntax error in <file>:(LINE,COL): ... and this validator
turns that into an offense. A file that parses cleanly produces nothing.
Configuration
To disable this validator:
Warnings/SyntaxError:
Enabled: false