Skip to content

Commit

Permalink
Make parallel the default
Browse files Browse the repository at this point in the history
  • Loading branch information
mjankowski committed Jan 16, 2025
1 parent ce8aad5 commit 78bdaed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/haml_lint/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class Options
# @param args [Array<String>] arguments passed via the command line
# @return [Hash] parsed options
def parse(args)
@options = {}
@options = default_options

OptionParser.new do |parser|
parser.banner = "Usage: #{APP_NAME} [options] [file1, file2, ...]"
Expand All @@ -32,6 +32,10 @@ def parse(args)

private

def default_options
{ parallel: true }
end

def add_linter_options(parser) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
parser.on('--auto-gen-config', 'Generate a configuration file acting as a TODO list') do
@options[:auto_gen_config] = true
Expand Down
6 changes: 6 additions & 0 deletions spec/haml_lint/options_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
subject { super().parse(args) }
let(:args) { [] }

context 'without options' do
it 'sets the default values' do
subject[:parallel].should == true
end
end

context 'with a configuration file specified' do
let(:args) { %w[--config some-config.yml] }

Expand Down

0 comments on commit 78bdaed

Please sign in to comment.