class AmberLSP::Rules::Controllers::ActionReturnRule

Defined in:

amber_lsp/rules/controllers/action_return_rule.cr

Constant Summary

CLASS_DECLARATION = /^(\s*)class\b/
CLASS_METHOD = /^\s{2,4}(?:(?:private|protected|public)\s+)?def\s+self\./
END_DECLARATION = /^(\s*)end\b/
METHOD_DECLARATION = /^(\s{2,4})(?:(private|protected|public)\s+)?def\s+([\w!?]+)/
RESPONSE_METHODS = ["render", "redirect_to", "redirect_back", "respond_with", "halt!"]
SKIPPED_METHODS = ["initialize", "before_action", "after_action", "before_filter", "after_filter"]
VISIBILITY_CHANGE = /^\s*(private|protected|public)\s*$/

Instance Method Summary

Instance methods inherited from class AmberLSP::Rules::BaseRule

applies_to : Array(String) applies_to, check(file_path : String, content : String) : Array(Diagnostic) check, default_severity : Severity default_severity, description : String description, find_all_line_ranges(content : String, pattern : Regex) : Array(TextRange) find_all_line_ranges, find_line_range(content : String, pattern : Regex) : TextRange | Nil find_line_range, id : String id, requires_amber_project? : Bool requires_amber_project?

Instance Method Detail

def applies_to : Array(String) #

[View source]
def check(file_path : String, content : String) : Array(Diagnostic) #

[View source]
def default_severity : AmberLSP::Rules::Severity #

[View source]
def description : String #

[View source]
def id : String #

[View source]