shard-ameba/src/ameba/rule.cr

22 lines
385 B
Crystal
Raw Normal View History

2017-10-30 20:00:01 +00:00
module Ameba
RULES = [
2017-10-31 21:15:24 +00:00
Rules::ComparisonToBoolean,
2017-10-30 20:00:01 +00:00
Rules::LineLength,
2017-10-31 15:50:05 +00:00
Rules::TrailingBlankLines,
2017-10-30 20:35:11 +00:00
Rules::TrailingWhitespace,
2017-10-31 20:11:49 +00:00
Rules::UnlessElse,
2017-10-30 20:00:01 +00:00
]
abstract struct Rule
abstract def test(source : Source)
def catch(source : Source)
source.tap { |s| test s }
end
def name
self.class.name.gsub("Ameba::Rules::", "")
end
end
end