cuke_linter 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +217 -211
  3. data/LICENSE.txt +21 -21
  4. data/README.md +160 -160
  5. data/cuke_linter.gemspec +59 -58
  6. data/exe/cuke_linter +112 -112
  7. data/lib/cuke_linter/configuration.rb +45 -45
  8. data/lib/cuke_linter/default_linters.rb +32 -32
  9. data/lib/cuke_linter/formatters/pretty_formatter.rb +84 -84
  10. data/lib/cuke_linter/gherkin.rb +10 -10
  11. data/lib/cuke_linter/linter_registration.rb +32 -32
  12. data/lib/cuke_linter/linters/background_does_more_than_setup_linter.rb +35 -35
  13. data/lib/cuke_linter/linters/element_with_common_tags_linter.rb +49 -49
  14. data/lib/cuke_linter/linters/element_with_duplicate_tags_linter.rb +48 -48
  15. data/lib/cuke_linter/linters/element_with_too_many_tags_linter.rb +46 -46
  16. data/lib/cuke_linter/linters/example_without_name_linter.rb +19 -19
  17. data/lib/cuke_linter/linters/feature_file_with_invalid_name_linter.rb +20 -20
  18. data/lib/cuke_linter/linters/feature_file_with_mismatched_name_linter.rb +25 -25
  19. data/lib/cuke_linter/linters/feature_with_too_many_different_tags_linter.rb +35 -35
  20. data/lib/cuke_linter/linters/feature_without_description_linter.rb +19 -19
  21. data/lib/cuke_linter/linters/feature_without_name_linter.rb +19 -19
  22. data/lib/cuke_linter/linters/feature_without_scenarios_linter.rb +23 -23
  23. data/lib/cuke_linter/linters/linter.rb +42 -42
  24. data/lib/cuke_linter/linters/outline_with_single_example_row_linter.rb +22 -22
  25. data/lib/cuke_linter/linters/single_test_background_linter.rb +19 -19
  26. data/lib/cuke_linter/linters/step_with_end_period_linter.rb +19 -19
  27. data/lib/cuke_linter/linters/step_with_too_many_characters_linter.rb +38 -38
  28. data/lib/cuke_linter/linters/test_name_with_too_many_characters_linter.rb +38 -38
  29. data/lib/cuke_linter/linters/test_should_use_background_linter.rb +80 -80
  30. data/lib/cuke_linter/linters/test_with_action_step_as_final_step_linter.rb +33 -33
  31. data/lib/cuke_linter/linters/test_with_bad_name_linter.rb +23 -23
  32. data/lib/cuke_linter/linters/test_with_no_action_step_linter.rb +33 -33
  33. data/lib/cuke_linter/linters/test_with_no_name_linter.rb +19 -19
  34. data/lib/cuke_linter/linters/test_with_no_verification_step_linter.rb +33 -33
  35. data/lib/cuke_linter/linters/test_with_setup_step_after_action_step_linter.rb +46 -46
  36. data/lib/cuke_linter/linters/test_with_setup_step_after_verification_step_linter.rb +46 -46
  37. data/lib/cuke_linter/linters/test_with_setup_step_as_final_step_linter.rb +33 -33
  38. data/lib/cuke_linter/linters/test_with_too_many_steps_linter.rb +27 -27
  39. data/lib/cuke_linter/version.rb +4 -4
  40. data/lib/cuke_linter.rb +196 -196
  41. data/testing/cucumber/features/command_line.feature +202 -202
  42. data/testing/cucumber/features/configuration/configuring_linters.feature +58 -58
  43. data/testing/cucumber/features/configuration/locally_scoping_linters.feature +55 -55
  44. data/testing/cucumber/features/configuration/using_configurations.feature +41 -41
  45. data/testing/cucumber/features/custom_linters.feature +56 -56
  46. data/testing/cucumber/features/default_linters.feature +57 -57
  47. data/testing/cucumber/features/formatters/pretty_formatter.feature +26 -26
  48. data/testing/cucumber/features/linters/background_does_more_than_setup.feature +84 -84
  49. data/testing/cucumber/features/linters/element_with_common_tags.feature +28 -28
  50. data/testing/cucumber/features/linters/element_with_duplicate_tags.feature +71 -71
  51. data/testing/cucumber/features/linters/element_with_too_many_tags.feature +70 -70
  52. data/testing/cucumber/features/linters/example_without_name.feature +34 -34
  53. data/testing/cucumber/features/linters/feature_file_with_invalid_name.feature +20 -20
  54. data/testing/cucumber/features/linters/feature_file_with_mismatched_name.feature +32 -32
  55. data/testing/cucumber/features/linters/feature_with_too_many_different_tags.feature +56 -56
  56. data/testing/cucumber/features/linters/feature_without_description.feature +17 -17
  57. data/testing/cucumber/features/linters/feature_without_name.feature +18 -18
  58. data/testing/cucumber/features/linters/feature_without_scenarios.feature +39 -39
  59. data/testing/cucumber/features/linters/outline_with_single_example_row.feature +23 -23
  60. data/testing/cucumber/features/linters/single_test_background.feature +24 -24
  61. data/testing/cucumber/features/linters/step_too_long.feature +43 -43
  62. data/testing/cucumber/features/linters/step_with_end_period.feature +21 -21
  63. data/testing/cucumber/features/linters/test_name_too_long.feature +41 -41
  64. data/testing/cucumber/features/linters/test_should_use_background.feature +29 -29
  65. data/testing/cucumber/features/linters/test_with_action_as_final_step.feature +50 -50
  66. data/testing/cucumber/features/linters/test_with_bad_name.feature +29 -29
  67. data/testing/cucumber/features/linters/test_with_no_action_step.feature +56 -56
  68. data/testing/cucumber/features/linters/test_with_no_name.feature +23 -23
  69. data/testing/cucumber/features/linters/test_with_no_verification_step.feature +58 -58
  70. data/testing/cucumber/features/linters/test_with_setup_step_after_action_step.feature +57 -57
  71. data/testing/cucumber/features/linters/test_with_setup_step_after_verification_step.feature +57 -57
  72. data/testing/cucumber/features/linters/test_with_setup_step_as_final_step.feature +50 -50
  73. data/testing/cucumber/features/linters/test_with_too_many_steps.feature +61 -61
  74. metadata +21 -25
  75. data/testing/cucumber/features/linters/rule_without_name.feature +0 -18
data/README.md CHANGED
@@ -1,160 +1,160 @@
1
- Basic stuff:
2
- [![Gem Version](https://badge.fury.io/rb/cuke_linter.svg)](https://rubygems.org/gems/cuke_linter)
3
- [![Project License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/mit-license.php)
4
- [![Downloads](https://img.shields.io/gem/dt/cuke_linter.svg)](https://rubygems.org/gems/cuke_linter)
5
-
6
- User stuff:
7
- [![Cucumber Docs](http://img.shields.io/badge/Documentation-Features-green.svg)](https://github.com/enkessler/cuke_linter/tree/master/testing/cucumber/features)
8
- [![Yard Docs](http://img.shields.io/badge/Documentation-API-blue.svg)](https://www.rubydoc.info/gems/cuke_linter)
9
-
10
- Developer stuff:
11
- [![Build Status](https://github.com/enkessler/cuke_linter/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/enkessler/cuke_linter/actions/workflows/ci.yml)
12
- [![Coverage Status](https://coveralls.io/repos/github/enkessler/cuke_linter/badge.svg?branch=master)](https://coveralls.io/github/enkessler/cuke_linter?branch=master)
13
- [![Maintainability](https://api.codeclimate.com/v1/badges/d1b86760e59a457c8e73/maintainability)](https://codeclimate.com/github/enkessler/cuke_linter/maintainability)
14
- [![Inline docs](http://inch-ci.org/github/enkessler/cuke_linter.svg?branch=master)](https://inch-ci.org/github/enkessler/cuke_linter?branch=master)
15
-
16
- ---
17
-
18
- # CukeLinter
19
-
20
- So you have started to use Cucumber to describe your system in the abstract, natural language style of Gherkin. But wait! All of your feature files are themselves code and that means that they may need the same protection from anti-patterns as the lower level source code of your system. Enter `cuke_linter`.
21
-
22
- This gem provides linting functionality for `.feature` files by building upon the modeling capabilities of the [cuke_modeler](https://github.com/enkessler/cuke_modeler) gem. By passing models through a set of linters, reports can be generated that will inform you of potential bugs, style violations, or anything else that you can define as a problem via custom linters!
23
-
24
- ## Installation
25
-
26
- Add this line to your application's Gemfile:
27
-
28
- ```ruby
29
- gem 'cuke_linter'
30
- ```
31
-
32
- And then execute:
33
-
34
- $ bundle
35
-
36
- Or install it yourself as:
37
-
38
- $ gem install cuke_linter
39
-
40
- ## Usage
41
-
42
- #### From the command line
43
-
44
- The easiest way to use the gem is to use all of the defaults by invoking it from the command line directly.
45
-
46
- ```
47
- $ cuke_linter
48
- ```
49
-
50
- Additional command line options can be provided that can adjust the default behavior. See [documentation](#documentation) for specifics.
51
-
52
- #### From a Ruby script
53
-
54
- The linter can also be used inside of a Ruby script, like so:
55
-
56
- ```
57
- require 'cuke_linter'
58
-
59
- CukeLinter.lint
60
- ```
61
-
62
- The linting will happen against a tree of `CukeModeler` models that is generated based on the current directory. You can generate your own model trees and use them instead, if desired, or even provide specific file paths that will be modeled and linted.
63
-
64
- `cuke_linter` comes with a set of pre-made linters and will use them by default but custom linters can be used instead. Custom linters can be any object that responds to `#lint` and returns a detected issue (or `nil`) in the format of
65
-
66
- ```
67
- { problem: 'some linting issue',
68
- location: 'path/to/file:line_number' }
69
- ```
70
-
71
- Note that a linter will receive, in turn, *every model* in a model tree in order for it to have the chance to detect problems with it. Checking the model's class before attempting to lint it is recommended.
72
-
73
- **In order to simplify the process of creating custom linters a base class is provided (see [documentation](#documentation)).**
74
-
75
- `cuke_linter` comes with a set of pre-made formatters and will use them by default but custom formatters can be used instead. Custom formatters can be any object that responds to `#format` and takes input data in the following format:
76
-
77
- ```
78
- [
79
- { linter: 'some linter name',
80
- problem: 'some linting issue',
81
- location: 'path/to/file:line_number' },
82
- { linter: 'some linter name',
83
- problem: 'some linting issue',
84
- location: 'path/to/file:line_number' },
85
- # etc.
86
- ]
87
- ```
88
-
89
- All formatted data will be output to STDOUT unless a file location is provided as an alternative.
90
-
91
- Below is an example of using non-default linting options.
92
-
93
- ```
94
- require 'cuke_linter'
95
-
96
- class MyCustomLinter
97
-
98
- def name
99
- 'MyCustomLinter'
100
- end
101
-
102
- def lint(model)
103
- return nil unless model.is_a?(CukeModeler::Scenario)
104
-
105
- if model.name.empty?
106
- { problem: 'Scenario has no name',
107
- location: "#{model.get_ancestor(:feature_file).path}:#{model.source_line}" }
108
- else
109
- nil
110
- end
111
- end
112
-
113
- end
114
-
115
- class MyCustomFormatter
116
-
117
- def format(linting_data)
118
- formatted_data = ''
119
-
120
- linting_data.each do |lint_item|
121
- formatted_data << "#{lint_item[:linter]}\n"
122
- formatted_data << " #{lint_item[:problem]}\n"
123
- formatted_data << " #{lint_item[:location]}\n"
124
- end
125
-
126
- formatted_data
127
- end
128
-
129
- end
130
-
131
- linter = MyCustomLinter.new
132
- formatter = MyCustomFormatter.new
133
- output_path = "#{__dir__}/my_report.txt"
134
- model_tree_root = CukeModeler::Directory.new(Dir.pwd)
135
- additional_file_path = 'path/to/some.feature'
136
-
137
- # Providing the formatter twice so that output also is printed to the console
138
- CukeLinter.lint(linters: [linter],
139
- formatters: [[formatter], [formatter, output_path]],
140
- model_trees: [model_tree_root],
141
- file_paths: [additional_file_path])
142
- ```
143
-
144
- ### Configuration
145
-
146
- Rather than using the default linters or providing a custom set of of modified linters every time linting occurs, which linters to use and any linter specific modifications (such as choosing a non-default dialect) can be configured in a more static manner via a configuration file or setting the configuration directly in code. See [documentation](#documentation) for specifics.
147
-
148
-
149
- ### <a id="documentation"></a>Everything Else
150
-
151
- For more detailed examples of usage, see the documentation [here](https://github.com/enkessler/cuke_linter/tree/master/testing/cucumber/features).
152
-
153
- ## Development and Contributing
154
-
155
- See [CONTRIBUTING.md](https://github.com/enkessler/cuke_linter/blob/master/CONTRIBUTING.md)
156
-
157
-
158
- ## License
159
-
160
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
1
+ Basic stuff:
2
+ [![Gem Version](https://badge.fury.io/rb/cuke_linter.svg)](https://rubygems.org/gems/cuke_linter)
3
+ [![Project License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/mit-license.php)
4
+ [![Downloads](https://img.shields.io/gem/dt/cuke_linter.svg)](https://rubygems.org/gems/cuke_linter)
5
+
6
+ User stuff:
7
+ [![Cucumber Docs](http://img.shields.io/badge/Documentation-Features-green.svg)](https://github.com/enkessler/cuke_linter/tree/master/testing/cucumber/features)
8
+ [![Yard Docs](http://img.shields.io/badge/Documentation-API-blue.svg)](https://www.rubydoc.info/gems/cuke_linter)
9
+
10
+ Developer stuff:
11
+ [![Build Status](https://github.com/enkessler/cuke_linter/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/enkessler/cuke_linter/actions/workflows/ci.yml)
12
+ [![Coverage Status](https://coveralls.io/repos/github/enkessler/cuke_linter/badge.svg?branch=master)](https://coveralls.io/github/enkessler/cuke_linter?branch=master)
13
+ [![Maintainability](https://api.codeclimate.com/v1/badges/d1b86760e59a457c8e73/maintainability)](https://codeclimate.com/github/enkessler/cuke_linter/maintainability)
14
+ [![Inline docs](http://inch-ci.org/github/enkessler/cuke_linter.svg?branch=master)](https://inch-ci.org/github/enkessler/cuke_linter?branch=master)
15
+
16
+ ---
17
+
18
+ # CukeLinter
19
+
20
+ So you have started to use Cucumber to describe your system in the abstract, natural language style of Gherkin. But wait! All of your feature files are themselves code and that means that they may need the same protection from anti-patterns as the lower level source code of your system. Enter `cuke_linter`.
21
+
22
+ This gem provides linting functionality for `.feature` files by building upon the modeling capabilities of the [cuke_modeler](https://github.com/enkessler/cuke_modeler) gem. By passing models through a set of linters, reports can be generated that will inform you of potential bugs, style violations, or anything else that you can define as a problem via custom linters!
23
+
24
+ ## Installation
25
+
26
+ Add this line to your application's Gemfile:
27
+
28
+ ```ruby
29
+ gem 'cuke_linter'
30
+ ```
31
+
32
+ And then execute:
33
+
34
+ $ bundle
35
+
36
+ Or install it yourself as:
37
+
38
+ $ gem install cuke_linter
39
+
40
+ ## Usage
41
+
42
+ #### From the command line
43
+
44
+ The easiest way to use the gem is to use all of the defaults by invoking it from the command line directly.
45
+
46
+ ```
47
+ $ cuke_linter
48
+ ```
49
+
50
+ Additional command line options can be provided that can adjust the default behavior. See [documentation](#documentation) for specifics.
51
+
52
+ #### From a Ruby script
53
+
54
+ The linter can also be used inside of a Ruby script, like so:
55
+
56
+ ```
57
+ require 'cuke_linter'
58
+
59
+ CukeLinter.lint
60
+ ```
61
+
62
+ The linting will happen against a tree of `CukeModeler` models that is generated based on the current directory. You can generate your own model trees and use them instead, if desired, or even provide specific file paths that will be modeled and linted.
63
+
64
+ `cuke_linter` comes with a set of pre-made linters and will use them by default but custom linters can be used instead. Custom linters can be any object that responds to `#lint` and returns a detected issue (or `nil`) in the format of
65
+
66
+ ```
67
+ { problem: 'some linting issue',
68
+ location: 'path/to/file:line_number' }
69
+ ```
70
+
71
+ Note that a linter will receive, in turn, *every model* in a model tree in order for it to have the chance to detect problems with it. Checking the model's class before attempting to lint it is recommended.
72
+
73
+ **In order to simplify the process of creating custom linters a base class is provided (see [documentation](#documentation)).**
74
+
75
+ `cuke_linter` comes with a set of pre-made formatters and will use them by default but custom formatters can be used instead. Custom formatters can be any object that responds to `#format` and takes input data in the following format:
76
+
77
+ ```
78
+ [
79
+ { linter: 'some linter name',
80
+ problem: 'some linting issue',
81
+ location: 'path/to/file:line_number' },
82
+ { linter: 'some linter name',
83
+ problem: 'some linting issue',
84
+ location: 'path/to/file:line_number' },
85
+ # etc.
86
+ ]
87
+ ```
88
+
89
+ All formatted data will be output to STDOUT unless a file location is provided as an alternative.
90
+
91
+ Below is an example of using non-default linting options.
92
+
93
+ ```
94
+ require 'cuke_linter'
95
+
96
+ class MyCustomLinter
97
+
98
+ def name
99
+ 'MyCustomLinter'
100
+ end
101
+
102
+ def lint(model)
103
+ return nil unless model.is_a?(CukeModeler::Scenario)
104
+
105
+ if model.name.empty?
106
+ { problem: 'Scenario has no name',
107
+ location: "#{model.get_ancestor(:feature_file).path}:#{model.source_line}" }
108
+ else
109
+ nil
110
+ end
111
+ end
112
+
113
+ end
114
+
115
+ class MyCustomFormatter
116
+
117
+ def format(linting_data)
118
+ formatted_data = ''
119
+
120
+ linting_data.each do |lint_item|
121
+ formatted_data << "#{lint_item[:linter]}\n"
122
+ formatted_data << " #{lint_item[:problem]}\n"
123
+ formatted_data << " #{lint_item[:location]}\n"
124
+ end
125
+
126
+ formatted_data
127
+ end
128
+
129
+ end
130
+
131
+ linter = MyCustomLinter.new
132
+ formatter = MyCustomFormatter.new
133
+ output_path = "#{__dir__}/my_report.txt"
134
+ model_tree_root = CukeModeler::Directory.new(Dir.pwd)
135
+ additional_file_path = 'path/to/some.feature'
136
+
137
+ # Providing the formatter twice so that output also is printed to the console
138
+ CukeLinter.lint(linters: [linter],
139
+ formatters: [[formatter], [formatter, output_path]],
140
+ model_trees: [model_tree_root],
141
+ file_paths: [additional_file_path])
142
+ ```
143
+
144
+ ### Configuration
145
+
146
+ Rather than using the default linters or providing a custom set of of modified linters every time linting occurs, which linters to use and any linter specific modifications (such as choosing a non-default dialect) can be configured in a more static manner via a configuration file or setting the configuration directly in code. See [documentation](#documentation) for specifics.
147
+
148
+
149
+ ### <a id="documentation"></a>Everything Else
150
+
151
+ For more detailed examples of usage, see the documentation [here](https://github.com/enkessler/cuke_linter/tree/master/testing/cucumber/features).
152
+
153
+ ## Development and Contributing
154
+
155
+ See [CONTRIBUTING.md](https://github.com/enkessler/cuke_linter/blob/master/CONTRIBUTING.md)
156
+
157
+
158
+ ## License
159
+
160
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/cuke_linter.gemspec CHANGED
@@ -1,58 +1,59 @@
1
- lib = File.expand_path('lib', __dir__)
2
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
- require 'cuke_linter/version'
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = 'cuke_linter'
7
- spec.version = CukeLinter::VERSION
8
- spec.authors = ['Eric Kessler']
9
- spec.email = ['morrow748@gmail.com']
10
-
11
- spec.summary = 'Lints feature files used by Cucumber and other similar frameworks.'
12
- spec.description = ["This gem provides linters for detecting common 'smells' in `.feature` files. ",
13
- 'In addition to the provided linters, custom linters can be made in order to ',
14
- 'create custom linting rules.'].join
15
- spec.homepage = 'https://github.com/enkessler/cuke_linter'
16
- spec.license = 'MIT'
17
-
18
- spec.metadata = {
19
- 'bug_tracker_uri' => 'https://github.com/enkessler/cuke_linter/issues',
20
- 'changelog_uri' => 'https://github.com/enkessler/cuke_linter/blob/master/CHANGELOG.md',
21
- 'documentation_uri' => 'https://www.rubydoc.info/gems/cuke_linter',
22
- 'homepage_uri' => 'https://github.com/enkessler/cuke_linter',
23
- 'source_code_uri' => 'https://github.com/enkessler/cuke_linter'
24
- }
25
-
26
-
27
- # Specify which files should be added to the gem when it is released.
28
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
29
- spec.files = Dir.chdir(File.expand_path('', __dir__)) do
30
- source_controlled_files = `git ls-files -z`.split("\x0")
31
- source_controlled_files.keep_if { |file| file =~ %r{^(lib|exe|testing/cucumber/features)} }
32
- source_controlled_files + ['README.md', 'LICENSE.txt', 'CHANGELOG.md', 'cuke_linter.gemspec']
33
- end
34
- spec.bindir = 'exe'
35
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
36
- spec.require_paths = ['lib']
37
-
38
- spec.required_ruby_version = '>= 2.1', '< 4.0'
39
-
40
- spec.add_runtime_dependency 'cuke_modeler', '>= 1.5', '< 4.0'
41
-
42
- spec.add_development_dependency 'bundler', '< 3.0'
43
- spec.add_development_dependency 'childprocess', '< 4.0'
44
- spec.add_development_dependency 'cucumber', '< 5.0'
45
- spec.add_development_dependency 'cuke_slicer', '>= 2.0.2', '< 3.0'
46
- spec.add_development_dependency 'ffi', '~> 1.0'
47
- spec.add_development_dependency 'parallel', '~> 1.0'
48
- spec.add_development_dependency 'rainbow', '< 4.0.0'
49
- spec.add_development_dependency 'rake', '~> 12.0'
50
- spec.add_development_dependency 'require_all', '~> 2.0'
51
- spec.add_development_dependency 'rspec', '~> 3.0'
52
- # RuboCop drops Ruby 2.1 support after this version and we need
53
- # to maintain Ruby 2.1 compatibility when writing code for this gem
54
- spec.add_development_dependency 'rubocop', '<= 0.57.2'
55
- spec.add_development_dependency 'simplecov', '< 1.0'
56
- spec.add_development_dependency 'simplecov-lcov', '< 1.0'
57
- spec.add_development_dependency 'yard', '< 1.0'
58
- end
1
+ lib = File.expand_path('lib', __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'cuke_linter/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = 'cuke_linter'
7
+ spec.version = CukeLinter::VERSION
8
+ spec.authors = ['Eric Kessler']
9
+ spec.email = ['morrow748@gmail.com']
10
+
11
+ spec.summary = 'Lints feature files used by Cucumber and other similar frameworks.'
12
+ spec.description = ["This gem provides linters for detecting common 'smells' in `.feature` files. ",
13
+ 'In addition to the provided linters, custom linters can be made in order to ',
14
+ 'create custom linting rules.'].join
15
+ spec.homepage = 'https://github.com/enkessler/cuke_linter'
16
+ spec.license = 'MIT'
17
+
18
+ spec.metadata = {
19
+ 'bug_tracker_uri' => 'https://github.com/enkessler/cuke_linter/issues',
20
+ 'changelog_uri' => 'https://github.com/enkessler/cuke_linter/blob/master/CHANGELOG.md',
21
+ 'documentation_uri' => 'https://www.rubydoc.info/gems/cuke_linter',
22
+ 'source_code_uri' => 'https://github.com/enkessler/cuke_linter',
23
+ 'rubygems_mfa_required' => 'true'
24
+ }
25
+
26
+
27
+ # Specify which files should be added to the gem when it is released.
28
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
29
+ spec.files = Dir.chdir(File.expand_path('', __dir__)) do
30
+ source_controlled_files = `git ls-files -z`.split("\x0")
31
+ source_controlled_files.keep_if { |file| file =~ %r{^(lib|exe|testing/cucumber/features)} }
32
+ source_controlled_files + ['README.md', 'LICENSE.txt', 'CHANGELOG.md', 'cuke_linter.gemspec']
33
+ end
34
+ spec.bindir = 'exe'
35
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
36
+ spec.require_paths = ['lib']
37
+
38
+ spec.required_ruby_version = '>= 2.1', '< 5.0'
39
+
40
+ spec.add_runtime_dependency 'cuke_modeler', '>= 1.5', '< 4.0'
41
+
42
+ spec.add_development_dependency 'bundler', '< 5.0'
43
+ spec.add_development_dependency 'childprocess', '< 6.0'
44
+ spec.add_development_dependency 'cucumber', '< 11.0'
45
+ spec.add_development_dependency 'cuke_slicer', '>= 2.0.2', '< 4.0'
46
+ spec.add_development_dependency 'ffi', '~> 1.0'
47
+ spec.add_development_dependency 'parallel', '~> 1.0'
48
+ spec.add_development_dependency 'rainbow', '< 4.0.0'
49
+ spec.add_development_dependency 'rake', '<14.0'
50
+ spec.add_development_dependency 'require_all', '~> 2.0'
51
+ spec.add_development_dependency 'rspec', '~> 3.0'
52
+ # Running recent RuboCop versions requires a recent version of Ruby but it can still lint against Ruby 2.1 styles.
53
+ # Can't set a lower bound because RuboCop will still get installed in the testing environments for earlier Rubies,
54
+ # even if it never actually gets run.
55
+ spec.add_development_dependency 'rubocop', '< 2.0'
56
+ spec.add_development_dependency 'simplecov', '< 1.0'
57
+ spec.add_development_dependency 'simplecov-lcov', '< 1.0'
58
+ spec.add_development_dependency 'yard', '< 1.0'
59
+ end