Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --strict option to make warnings fatal #34

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading