Sha256: 43ee81e18e6adc9cf99395541947c319ef7a932d286314ebef7d6c1b9c882d97
Contents?: true
Size: 732 Bytes
Versions: 15
Compression:
Stored size: 732 Bytes
Contents
module Skeptic module Rules class NoSemicolons DESCRIPTION = 'Do not allow semicolons as statement separators' def initialize(enabled = false) @enabled = enabled end def apply_to(code, tokens, sexp) @locations = tokens. select { |location, type, token| token == ';' and type == :on_semicolon }. map { |location, type, token| location } self end def violations @locations.map do |line, column| "You have a semicolon at line #{line}, column #{column}" end end def name 'No semicolons as expression separators' end def semicolon_locations @locations end end end end
Version data entries
15 entries across 15 versions & 1 rubygems