Remove extraneous blank lines

This commit is contained in:
Sijawusz Pur Rahnama 2021-01-17 18:24:49 +01:00
parent af5d825015
commit 928a260d51
12 changed files with 0 additions and 26 deletions

View file

@ -44,7 +44,6 @@ module Ameba::AST
# end
# end
# ```
#
def in_loop?
@parent.loop?
end

View file

@ -28,7 +28,6 @@ module Ameba::AST
# ```
# Assignment.new(node, variable, scope)
# ```
#
def initialize(@node, @variable, @scope)
if scope = @variable.scope
@branch = Branch.of(@node, scope)
@ -95,7 +94,6 @@ module Ameba::AST
# puts(b)
# end
# ```
#
def transformed?
return false unless (assign = node).is_a?(Crystal::Assign)
return false unless (value = assign.value).is_a?(Crystal::Call)

View file

@ -27,7 +27,6 @@ module Ameba::AST
# ```
# Variable.new(node, scope)
# ```
#
def initialize(@node, @scope)
end
@ -45,7 +44,6 @@ module Ameba::AST
# variable.assign(node2)
# variable.assignment.size # => 2
# ```
#
def assign(node, scope)
assignments << Assignment.new(node, self, scope)
@ -69,7 +67,6 @@ module Ameba::AST
# variable = Variable.new(node, scope)
# variable.reference(var_node, some_scope)
# ```
#
def reference(node : Crystal::Var, scope : Scope)
Reference.new(node, scope).tap do |reference|
references << reference

View file

@ -15,7 +15,6 @@ module Ameba::AST
# ```
# visitor = Ameba::AST::NodeVisitor.new(rule, source)
# ```
#
def initialize(@rule, @source)
@source.ast.accept self
end

View file

@ -20,7 +20,6 @@ module Ameba::Formatter
# ExplainFormatter.new output,
# {file: path, line: line_number, column: column_number}
# ```
#
def initialize(@output, loc)
@location = Crystal::Location.new(loc[:file], loc[:line], loc[:column])
end

View file

@ -7,7 +7,6 @@ module Ameba
# ```
# find_files_by_globs(["**/*.cr", "!lib"])
# ```
#
def find_files_by_globs(globs)
rejected = rejected_globs(globs)
selected = globs - rejected
@ -20,7 +19,6 @@ module Ameba
# ```
# expand(["spec/*.cr", "src"]) # => all files in src folder + first level specs
# ```
#
def expand(globs)
globs.flat_map do |glob|
glob += "/**/*.cr" if File.directory?(glob)

View file

@ -36,7 +36,6 @@ module Ameba
# Time.epoch(1483859302)
# end
# ```
#
def location_disabled?(location, rule)
return false if rule.name.in?(Rule::SPECIAL)
return false unless line_number = location.try &.line_number.try &.- 1
@ -65,7 +64,6 @@ module Ameba
# line = "# # ameba:disable Rule1, Rule2"
# parse_inline_directive(line) # => nil
# ```
#
def parse_inline_directive(line)
if directive = COMMENT_DIRECTIVE_REGEX.match(line)
return if commented_out?(line.gsub(directive[0], ""))

View file

@ -50,7 +50,6 @@ module Ameba::Rule
# source = MyRule.new.catch(source)
# source.valid?
# ```
#
def catch(source : Source)
source.tap { |s| test s }
end
@ -65,7 +64,6 @@ module Ameba::Rule
#
# MyRule.new.name # => "MyRule"
# ```
#
def name
{{@type}}.rule_name
end
@ -79,7 +77,6 @@ module Ameba::Rule
#
# MyGroup::MyRule.new.group # => "MyGroup"
# ```
#
def group
{{@type}}.group_name
end
@ -91,7 +88,6 @@ module Ameba::Rule
# ```
# my_rule.excluded?(source) # => true or false
# ```
#
def excluded?(source)
excluded.try &.any? do |path|
source.matches_path?(path) ||
@ -105,7 +101,6 @@ module Ameba::Rule
# ```
# my_rule.special? # => true or false
# ```
#
def special?
name.in?(SPECIAL)
end

View file

@ -38,7 +38,6 @@ module Ameba
#
# Ameba::Runner.new config
# ```
#
def initialize(config : Config)
@sources = config.sources
@formatter = config.formatter
@ -64,7 +63,6 @@ module Ameba
# runner = Ameba::Runner.new config
# runner.run # => returns runner again
# ```
#
def run
@formatter.started @sources
channels = @sources.map { Channel(Exception?).new }
@ -112,7 +110,6 @@ module Ameba
# runner.run
# runner.explain({file: file, line: l, column: c})
# ```
#
def explain(location, output = STDOUT)
Formatter::ExplainFormatter.new(output, location).finished @sources
end
@ -125,7 +122,6 @@ module Ameba
# runner.run
# runner.success? # => true or false
# ```
#
def success?
@sources.all? do |source|
source.issues

View file

@ -23,7 +23,6 @@ module Ameba
# Severity.parse("convention") # => Severity::Convention
# Severity.parse("foo-bar") # => Exception: Incorrect severity name
# ```
#
def self.parse(name : String)
super name
rescue ArgumentError

View file

@ -19,7 +19,6 @@ module Ameba
# path = "./src/source.cr"
# Ameba::Source.new File.read(path), path
# ```
#
def initialize(@code, @path = "")
end

View file

@ -18,7 +18,6 @@ module Ameba
# source = Ameba::Source.new code, path
# Ameba::Tokenizer.new(source)
# ```
#
def initialize(source)
@lexer = Crystal::Lexer.new source.code
@lexer.count_whitespace = true
@ -33,7 +32,6 @@ module Ameba
# lexer = Crystal::Lexer.new(code)
# Ameba::Tokenizer.new(lexer)
# ```
#
def initialize(@lexer : Crystal::Lexer)
end
@ -44,7 +42,6 @@ module Ameba
# puts token
# end
# ```
#
def run(&block : Crystal::Token -> _)
run_normal_state @lexer, &block
true