Skip to content

Commit

Permalink
Merge pull request #11 from funkwerk/feature/readded_ARGV
Browse files Browse the repository at this point in the history
Feature/readded argv
  • Loading branch information
lindt authored Nov 3, 2017
2 parents 556d3dd + 9e577d1 commit 816d080
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 9 deletions.
8 changes: 6 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ end

desc 'Publishes the Gem'
task :push do
sh 'gem push gherkin_lint-1.0.0.gem'
sh 'gem push gherkin_lint-1.1.0.gem'
end

desc 'Checks ruby style'
task :rubocop do
sh 'rubocop'
begin
sh 'rubocop'
rescue
puts 'Rubocop failed'
end
end

task test: :rubocop
Expand Down
8 changes: 3 additions & 5 deletions bin/gherkin_lint
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@ OptionParser.new do |opts|
opts.on('--disable [CHECKS]', 'Disabled checks. Separated by ","') do |checks|
options[:disable] = checks.split(',')
end
opts.on('-f', '--filepath [file/s]', 'File path where features are located') do |file|
options[:files] = file
end
end.parse!

linter = GherkinLint::GherkinLint.new
linter.disable options[:disable] if options.key? :disable
linter.enable options[:enable] if options.key? :enable
linter.set_linter

options[:files] = 'features/**/*.feature' if options[:files].nil?
files = Dir.glob(options[:files])
files = ARGV
files = 'features/**/*.feature' if ARGV.empty?
files = Dir.glob(files)

files.each do |file|
linter.analyze file
Expand Down
1 change: 1 addition & 0 deletions features/avoid_outline_for_single_example.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@disableUnknownVariable
Feature: Avoid Outline for single Example
As a Business Analyst
I do not want a period at the end of the scenario
Expand Down
1 change: 1 addition & 0 deletions features/missing_example_name.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@disableUnknownVariable
Feature: Missing Example Name
As a Customer
I want examples to be named
Expand Down
1 change: 1 addition & 0 deletions features/missing_verification.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Feature: Missing Verification
"""

@disableBadScenarioName
Scenario: Missing Verification
Given a file named "lint.feature" with:
"""
Expand Down
1 change: 1 addition & 0 deletions features/unknown_variable.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@disableUnknownVariable
Feature: Unknown Variable
As a Business Analyst
I want to be warned about unknown variables
Expand Down
1 change: 1 addition & 0 deletions features/unused_variable.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@disableUnknownVariable
Feature: Unused Variable
As a Business Analyst
I want to be warned about unused variables
Expand Down
2 changes: 2 additions & 0 deletions features/use_background.feature
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Feature: Use Background
"""

@disableUnknownVariable
Scenario: Same Given in Outlines
Given a file named "lint.feature" with:
"""
Expand Down Expand Up @@ -88,6 +89,7 @@ Feature: Use Background
"""
"""

@disableUnknownVariable
Scenario: Valid Single Scenario
Given a file named "lint.feature" with:
"""
Expand Down
4 changes: 2 additions & 2 deletions gherkin_lint.gemspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|
s.name = 'gherkin_lint'
s.version = '1.0.0'
s.date = '2017-08-25'
s.version = '1.1.0'
s.date = '2017-11-03'
s.summary = 'Gherkin Lint'
s.description = 'Lint Gherkin Files'
s.authors = ['Stefan Rohe', 'Nishtha Argawal', 'John Gluck']
Expand Down

0 comments on commit 816d080

Please sign in to comment.