Class: Danger::DangerOrmolu
- Inherits:
-
Plugin
- Object
- Plugin
- Danger::DangerOrmolu
- Defined in:
- lib/ormolu/plugin.rb
Overview
Lint haskell files against ormolu formatting
Instance Method Summary collapse
-
#check(files, path: 'ormolu', args: '', level: :warn) ⇒ void
Check that the files are correctly formatted.
Instance Method Details
#check(files, path: 'ormolu', args: '', level: :warn) ⇒ void
This method returns an undefined value.
Check that the files are correctly formatted
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ormolu/plugin.rb', line 18 def check(files, path: 'ormolu', args: '', level: :warn) files .each do |file| result = `#{path} #{args} --mode stdout --check-idempotence "#{file}" | diff "#{file}" -` next if result.empty? extract_diffs(result.lines) .each do |diff| inconsistence(file, diff[:line], diff[:diff], level) end end end |