Skip to content

Commit

Permalink
Add --strict option to make warnings fatal
Browse files Browse the repository at this point in the history
Fixes #25
  • Loading branch information
silug committed Oct 29, 2024
1 parent 2f067cb commit 63d115c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/scelint/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Scelint::CLI < Thor
class_option :debug, type: :boolean, aliases: '-d', default: false

desc 'lint PATH', 'Lint all files in PATH'
option :strict, type: :boolean, aliases: '-s', default: false
def lint(*paths)
paths = ['.'] if paths.nil? || paths.empty?
lint = Scelint::Lint.new(paths)
Expand Down Expand Up @@ -41,6 +42,7 @@ def lint(*paths)

if lint.warnings.count > 0
message += " #{lint.warnings.count} warnings."
exit_code = 1 if options[:strict]
end

logger.info message
Expand Down

0 comments on commit 63d115c

Please sign in to comment.