Exception: Reek::Errors::SyntaxError
- Defined in:
- lib/reek/errors/syntax_error.rb
Overview
Gets raised when Reek is unable to process the source due to a SyntaxError
Constant Summary collapse
- TEMPLATE =
"Source '%<source>s' cannot be processed by Reek due to a syntax error in the source file."
- LONG_TEMPLATE =
<<-MESSAGE !!! %<message>s This is a problem that is outside of Reek's scope and should be fixed by you, the user, in order for Reek being able to continue. Things you can try: - Check the syntax of the problematic file - If the file is not in fact a Ruby file, exclude it in your .reek.yml file Exception message: %<exception>s Original backtrace: %<original>s !!! MESSAGE
Instance Method Summary collapse
-
#initialize(origin:) ⇒ SyntaxError
constructor
A new instance of SyntaxError.
- #long_message ⇒ Object
Constructor Details
#initialize(origin:) ⇒ SyntaxError
Returns a new instance of SyntaxError.
33 34 35 |
# File 'lib/reek/errors/syntax_error.rb', line 33 def initialize(origin:) super(format(TEMPLATE, source: origin)) end |
Instance Method Details
#long_message ⇒ Object
37 38 39 40 41 42 |
# File 'lib/reek/errors/syntax_error.rb', line 37 def format(LONG_TEMPLATE, message: , exception: cause.inspect, original: cause.backtrace.join("\n\t")) end |