Apply default formatting

This commit is contained in:
Vitalii Elenhaupt 2018-09-03 00:17:56 +03:00
parent bbb0cf51e7
commit f4680a75f4
No known key found for this signature in database
GPG key ID: 7558EF3A4056C706
7 changed files with 15 additions and 15 deletions

View file

@ -58,9 +58,9 @@ module Ameba
it "shows issue end_location" do
s = Source.new ""
s.add_issue DummyRule.new,
Crystal::Location.new("path", 3, 3),
Crystal::Location.new("path", 5, 4),
"message"
Crystal::Location.new("path", 3, 3),
Crystal::Location.new("path", 5, 4),
"message"
result = get_result [s]
end_location = result["sources"][0]["issues"][0]["end_location"]

View file

@ -5,8 +5,8 @@ module Ameba
it "tokenizes #{str}" do
([] of Symbol).tap do |token_types|
Tokenizer.new(Source.new str)
.run { |token| token_types << token.type }
.should be_true
.run { |token| token_types << token.type }
.should be_true
end.should eq expected
end
end

View file

@ -26,7 +26,7 @@ class Ameba::Config
setter files : Array(String)?
getter rules : Array(Rule::Base)
@rule_groups: Hash(String, Array(Rule::Base))
@rule_groups : Hash(String, Array(Rule::Base))
# Creates a new instance of `Ameba::Config` based on YAML parameters.
#

View file

@ -51,8 +51,8 @@ module Ameba::Formatter
private def rule_todo(rule, issues)
rule.excluded =
issues.map(&.location.try &.filename.try &.to_s)
.compact
.uniq!
.compact
.uniq!
{rule.name => rule}.to_yaml
end

View file

@ -39,9 +39,9 @@ module Ameba::Rule::Lint
private def duplicated_keys(entries)
entries.map(&.key)
.group_by(&.itself)
.select { |_, v| v.size > 1 }
.map { |k, _| k }
.group_by(&.itself)
.select { |_, v| v.size > 1 }
.map { |k, _| k }
end
end
end

View file

@ -43,7 +43,7 @@ module Ameba
@unneeded_disable_directive_rule =
config.rules
.find &.name.==(Rule::Lint::UnneededDisableDirective.rule_name)
.find &.name.==(Rule::Lint::UnneededDisableDirective.rule_name)
end
# :nodoc:
@ -106,7 +106,7 @@ module Ameba
wildcard += "/**/*.cr" if File.directory?(wildcard)
Dir[wildcard]
end.flatten
.map { |path| Source.new File.read(path), path }
.map { |path| Source.new File.read(path), path }
end
end
end

View file

@ -52,8 +52,8 @@ module Ameba
def ast
@ast ||=
Crystal::Parser.new(code)
.tap { |parser| parser.filename = @path }
.parse
.tap { |parser| parser.filename = @path }
.parse
end
def fullpath