Class: PreCommit::RubySymbolHashrockets
- Inherits:
-
Object
- Object
- PreCommit::RubySymbolHashrockets
- Defined in:
- lib/pre-commit/checks/ruby_symbol_hashrockets.rb
Constant Summary collapse
- HASHROCKET_PATTERN =
'[^:](:{1}(?:\$|@|@@|[_A-Za-z])?\w*[=!?]?\s*=>\s*)'
Class Method Summary collapse
Class Method Details
.call(staged_files) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/pre-commit/checks/ruby_symbol_hashrockets.rb', line 7 def self.call(staged_files) return if staged_files.empty? lines = `#{Utils.grep} '#{HASHROCKET_PATTERN}' #{staged_files.join(" ")}`.strip return unless $?.success? "detected :symbol => value hashrocket:\n#{lines}" end |