rack-link_headers 2.3.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -6
  3. data/lib/rack/link_headers/version.rb +3 -3
  4. data/rack-link-headers.gemspec +7 -4
  5. data/test/helper_test.rb +7 -4
  6. data/vendor/bundle/ruby/3.3.0/bundler/gems/rubocop-config-943facea9d8f/LICENSE +21 -0
  7. data/vendor/bundle/ruby/3.3.0/bundler/gems/rubocop-config-943facea9d8f/README.md +23 -0
  8. data/vendor/bundle/ruby/3.3.0/bundler/gems/rubocop-config-943facea9d8f/rubocop-config.gemspec +31 -0
  9. data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.2/LICENSE.MIT +20 -0
  10. data/vendor/bundle/ruby/3.3.0/gems/ast-2.4.2/README.YARD.md +12 -0
  11. data/vendor/bundle/ruby/3.3.0/gems/json-2.7.2/LICENSE +56 -0
  12. data/vendor/bundle/ruby/3.3.0/gems/json-2.7.2/README.md +416 -0
  13. data/vendor/bundle/ruby/3.3.0/gems/json-2.7.2/json.gemspec +68 -0
  14. data/vendor/bundle/ruby/3.3.0/gems/language_server-protocol-3.17.0.3/LICENSE.txt +21 -0
  15. data/vendor/bundle/ruby/3.3.0/gems/language_server-protocol-3.17.0.3/README.md +88 -0
  16. data/vendor/bundle/ruby/3.3.0/gems/minitest-5.25.1/README.rdoc +835 -0
  17. data/vendor/bundle/ruby/3.3.0/gems/parallel-1.26.3/MIT-LICENSE.txt +20 -0
  18. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.5.0/LICENSE.txt +25 -0
  19. data/vendor/bundle/ruby/3.3.0/gems/parser-3.3.5.0/parser.gemspec +43 -0
  20. data/vendor/bundle/ruby/3.3.0/gems/racc-1.8.1/README.ja.rdoc +58 -0
  21. data/vendor/bundle/ruby/3.3.0/gems/racc-1.8.1/README.rdoc +60 -0
  22. data/vendor/bundle/ruby/3.3.0/gems/rack-3.1.7/CHANGELOG.md +994 -0
  23. data/vendor/bundle/ruby/3.3.0/gems/rack-3.1.7/MIT-LICENSE +20 -0
  24. data/vendor/bundle/ruby/3.3.0/gems/rack-3.1.7/README.md +328 -0
  25. data/vendor/bundle/ruby/3.3.0/gems/rainbow-3.1.1/LICENSE +20 -0
  26. data/vendor/bundle/ruby/3.3.0/gems/rainbow-3.1.1/README.markdown +227 -0
  27. data/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/MIT-LICENSE +21 -0
  28. data/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/README.rdoc +155 -0
  29. data/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/rake.gemspec +101 -0
  30. data/vendor/bundle/ruby/3.3.0/gems/rake-release-1.3.0/LICENSE +21 -0
  31. data/vendor/bundle/ruby/3.3.0/gems/rake-release-1.3.0/README.md +107 -0
  32. data/vendor/bundle/ruby/3.3.0/gems/rake-release-1.3.0/rake-release.gemspec +23 -0
  33. data/vendor/bundle/ruby/3.3.0/gems/regexp_parser-2.9.2/LICENSE +22 -0
  34. data/vendor/bundle/ruby/3.3.0/gems/regexp_parser-2.9.2/regexp_parser.gemspec +34 -0
  35. data/vendor/bundle/ruby/3.3.0/gems/rexml-3.3.7/LICENSE.txt +22 -0
  36. data/vendor/bundle/ruby/3.3.0/gems/rexml-3.3.7/README.md +57 -0
  37. data/vendor/bundle/ruby/3.3.0/gems/rubocop-1.65.1/LICENSE.txt +20 -0
  38. data/vendor/bundle/ruby/3.3.0/gems/rubocop-1.65.1/README.md +251 -0
  39. data/vendor/bundle/ruby/3.3.0/gems/rubocop-ast-1.32.3/LICENSE.txt +20 -0
  40. data/vendor/bundle/ruby/3.3.0/gems/rubocop-ast-1.32.3/README.md +56 -0
  41. data/vendor/bundle/ruby/3.3.0/gems/rubocop-capybara-2.21.0/CHANGELOG.md +85 -0
  42. data/vendor/bundle/ruby/3.3.0/gems/rubocop-capybara-2.21.0/MIT-LICENSE.md +21 -0
  43. data/vendor/bundle/ruby/3.3.0/gems/rubocop-capybara-2.21.0/README.md +88 -0
  44. data/vendor/bundle/ruby/3.3.0/gems/rubocop-factory_bot-2.26.1/CHANGELOG.md +116 -0
  45. data/vendor/bundle/ruby/3.3.0/gems/rubocop-factory_bot-2.26.1/MIT-LICENSE.md +21 -0
  46. data/vendor/bundle/ruby/3.3.0/gems/rubocop-factory_bot-2.26.1/README.md +88 -0
  47. data/vendor/bundle/ruby/3.3.0/gems/rubocop-performance-1.21.1/LICENSE.txt +20 -0
  48. data/vendor/bundle/ruby/3.3.0/gems/rubocop-performance-1.21.1/README.md +97 -0
  49. data/vendor/bundle/ruby/3.3.0/gems/rubocop-rspec-3.0.5/CHANGELOG.md +1034 -0
  50. data/vendor/bundle/ruby/3.3.0/gems/rubocop-rspec-3.0.5/MIT-LICENSE.md +21 -0
  51. data/vendor/bundle/ruby/3.3.0/gems/rubocop-rspec-3.0.5/README.md +109 -0
  52. data/vendor/bundle/ruby/3.3.0/gems/rubocop-rspec_rails-2.30.0/CHANGELOG.md +84 -0
  53. data/vendor/bundle/ruby/3.3.0/gems/rubocop-rspec_rails-2.30.0/MIT-LICENSE.md +21 -0
  54. data/vendor/bundle/ruby/3.3.0/gems/rubocop-rspec_rails-2.30.0/README.md +90 -0
  55. data/vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/LICENSE.txt +19 -0
  56. data/vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/README.md +131 -0
  57. data/vendor/bundle/ruby/3.3.0/gems/unicode-display_width-2.6.0/CHANGELOG.md +200 -0
  58. data/vendor/bundle/ruby/3.3.0/gems/unicode-display_width-2.6.0/MIT-LICENSE.txt +22 -0
  59. data/vendor/bundle/ruby/3.3.0/gems/unicode-display_width-2.6.0/README.md +171 -0
  60. data/vendor/bundle/ruby/3.3.0/specifications/ast-2.4.2.gemspec +30 -0
  61. data/vendor/bundle/ruby/3.3.0/specifications/json-2.7.2.gemspec +0 -0
  62. data/vendor/bundle/ruby/3.3.0/specifications/language_server-protocol-3.17.0.3.gemspec +31 -0
  63. data/vendor/bundle/ruby/3.3.0/specifications/minitest-5.25.1.gemspec +31 -0
  64. data/vendor/bundle/ruby/3.3.0/specifications/parallel-1.26.3.gemspec +21 -0
  65. data/vendor/bundle/ruby/3.3.0/specifications/parser-3.3.5.0.gemspec +37 -0
  66. data/vendor/bundle/ruby/3.3.0/specifications/racc-1.8.1.gemspec +28 -0
  67. data/vendor/bundle/ruby/3.3.0/specifications/rack-3.1.7.gemspec +31 -0
  68. data/vendor/bundle/ruby/3.3.0/specifications/rainbow-3.1.1.gemspec +25 -0
  69. data/vendor/bundle/ruby/3.3.0/specifications/rake-13.2.1.gemspec +26 -0
  70. data/vendor/bundle/ruby/3.3.0/specifications/rake-release-1.3.0.gemspec +26 -0
  71. data/vendor/bundle/ruby/3.3.0/specifications/regexp_parser-2.9.2.gemspec +22 -0
  72. data/vendor/bundle/ruby/3.3.0/specifications/rexml-3.3.7.gemspec +25 -0
  73. data/vendor/bundle/ruby/3.3.0/specifications/rubocop-1.65.1.gemspec +39 -0
  74. data/vendor/bundle/ruby/3.3.0/specifications/rubocop-ast-1.32.3.gemspec +28 -0
  75. data/vendor/bundle/ruby/3.3.0/specifications/rubocop-capybara-2.21.0.gemspec +27 -0
  76. data/vendor/bundle/ruby/3.3.0/specifications/rubocop-factory_bot-2.26.1.gemspec +27 -0
  77. data/vendor/bundle/ruby/3.3.0/specifications/rubocop-performance-1.21.1.gemspec +29 -0
  78. data/vendor/bundle/ruby/3.3.0/specifications/rubocop-rspec-3.0.5.gemspec +28 -0
  79. data/vendor/bundle/ruby/3.3.0/specifications/rubocop-rspec_rails-2.30.0.gemspec +28 -0
  80. data/vendor/bundle/ruby/3.3.0/specifications/ruby-progressbar-1.13.0.gemspec +29 -0
  81. data/vendor/bundle/ruby/3.3.0/specifications/unicode-display_width-2.6.0.gemspec +29 -0
  82. metadata +84 -8
@@ -0,0 +1,116 @@
1
+ # Changelog
2
+
3
+ ## Master (Unreleased)
4
+
5
+ ## 2.26.1 (2024-06-12)
6
+
7
+ - Bump RuboCop requirement to +1.61. ([@ydah])
8
+
9
+ ## 2.26.0 (2024-06-08)
10
+
11
+ - Fix a false positive for `FactoryBot/AssociationStyle` when using nested factories with traits. ([@jaydorsey])
12
+ - Support `AutoCorrect: contextual` option for LSP. ([@ydah])
13
+
14
+ ## 2.25.1 (2024-01-08)
15
+
16
+ - Fix a false positive for `FactoryBot/CreateList` when create call does have method calls and repeat multiple times with other argument. ([@ydah])
17
+ - Fix an error occurred for `FactoryBot/IdSequence` when `sequence` with non-symbol argument or without argument. ([@ydah])
18
+
19
+ ## 2.25.0 (2024-01-04)
20
+
21
+ - Fix a false positive for `FactoryBot/FactoryNameStyle` when namespaced models. ([@ydah])
22
+ - Add new `FactoryBot/ExcessiveCreateList` cop. ([@ddieulivol])
23
+ - Fix a false positive for `FactoryBot/ConsistentParenthesesStyle` when hash pinning. ([@ydah])
24
+
25
+ ## 2.24.0 (2023-09-18)
26
+
27
+ - Fix `FactoryBot/AssociationStyle` cop to ignore explicit associations with `strategy: :build`. ([@pirj])
28
+ - Change `FactoryBot/CreateList` so that it is not an offense if not repeated multiple times. ([@ydah])
29
+ - Fix a false positive for `FactoryBot/AssociationStyle` when `association` is called in trait block and column name is keyword. ([@ydah])
30
+ - Fix a false positive for `FactoryBot/AssociationStyle` when `EnforcedStyle: Explicit` and using trait within trait. ([@ydah])
31
+ - Change `FactoryBot/AssociationStyle`, `FactoryBot/AttributeDefinedStatically`, `FactoryBot/CreateList` and `FactoryBot/FactoryClassName` to work with minitest style directory. ([@ydah])
32
+ - Add `FactoryBot/IdSequence` cop. ([@owst])
33
+
34
+ ## 2.23.1 (2023-05-15)
35
+
36
+ - Fix `FactoryBot/AssociationStyle` cop for a blockless `factory`. ([@pirj])
37
+
38
+ ## 2.23.0 (2023-05-15)
39
+
40
+ - Add `FactoryBot/FactoryAssociationWithStrategy` cop. ([@morissetcl])
41
+ - Mark `FactoryBot/CreateList` as `SafeAutoCorrect: false`. ([@r7kamura])
42
+ - Change `FactoryBot/CreateList` so that it considers `times.map`. ([@r7kamura])
43
+ - Add `FactoryBot/RedundantFactoryOption` cop. ([@r7kamura])
44
+ - Add `ExplicitOnly` configuration option to `FactoryBot/ConsistentParenthesesStyle`, `FactoryBot/CreateList` and `FactoryBot/FactoryNameStyle`. ([@ydah])
45
+ - Change `FactoryBot/CreateList` so that it checks same factory calls in an Array. ([@r7kamura])
46
+ - Add `FactoryBot/AssociationStyle` cop. ([@r7kamura])
47
+
48
+ ## 2.22.0 (2023-05-04)
49
+
50
+ - Extracted from `rubocop-rspec` into a separate repository for easier use with Minitest/Cucumber. ([@ydah])
51
+
52
+ ## Previously (see [rubocop-rspec's changelist](https://github.com/rubocop/rubocop-rspec/blob/70a97b1895ce4b9bcd6ff336d5d343ddc6175fe6/CHANGELOG.md) for details)
53
+
54
+ - Fix a false positive for `RSpec/FactoryBot/ConsistentParenthesesStyle` inside `&&`, `||` and `:?` when `omit_parentheses` is on. ([@dmitrytsepelev])
55
+ - Add new `RSpec/FactoryBot/FactoryNameStyle` cop. ([@ydah])
56
+ - Fix wrong autocorrection in `n_times` style on `RSpec/FactoryBot/CreateList`. ([@r7kamura])
57
+ - Fix a false positive for `RSpec/FactoryBot/ConsistentParenthesesStyle` when using `generate` with multiple arguments. ([@ydah])
58
+ - Fix `RSpec/FactoryBot/ConsistentParenthesesStyle` to ignore calls without the first positional argument. ([@pirj])
59
+ - Fix `RSpec/FactoryBot/ConsistentParenthesesStyle` to ignore calls inside a Hash or an Array. ([@pirj])
60
+ - Fix an incorrect autocorrect for `FactoryBot/ConsistentParenthesesStyle` with `omit_parentheses` option when method name and first argument are not on same line. ([@ydah])
61
+ - Add `RSpec/FactoryBot/ConsistentParenthesesStyle` cop. ([@Liberatys])
62
+ - Support `Array.new(n)` on `RSpec/FactoryBot/CreateList` cop. ([@r7kamura])
63
+ - Fixed false offense detection in `FactoryBot/CreateList` when a n.times block is including method calls in the factory create arguments. ([@ngouy])
64
+ - Fix error in `RSpec/RSpec/FactoryBot/CreateList` cop for empty block. ([@tejasbubane])
65
+ - Fix `RSpec/FactoryBot/SyntaxMethods` and `RSpec/Capybara/FeatureMethods` to inspect shared groups. ([@pirj])
66
+ - Add new `RSpec/FactoryBot/SyntaxMethods` cop. ([@leoarnold])
67
+ - Change namespace of several cops (`Capybara/*` -> `RSpec/Capybara/*`, `FactoryBot/*` -> `RSpec/FactoryBot/*`, `Rails/*` -> `RSpec/Rails/*`). ([@pirj], [@bquorning])
68
+ - Fix `FactoryBot/AttributeDefinedStatically` to allow `#traits_for_enum` without a block. ([@harrylewis])
69
+ - Improve the performance of `FactoryBot/AttributeDefinedStatically`, `RSpec/InstanceVariable`, `RSpec/LetSetup`, `RSpec/NestedGroups` and `RSpec/ReturnFromStub`. ([@andrykonchin])
70
+ - Improve message and description of `FactoryBot/FactoryClassName`. ([@ybiquitous])
71
+ - Fix `FactoryBot/FactoryClassName` to ignore `Hash` and `OpenStruct`. ([@jfragoulis])
72
+ - Add `FactoryBot/FactoryClassName` cop. ([@jfragoulis])
73
+ - Fix `FactoryBot/AttributeDefinedStatically` not working with an explicit receiver. ([@composerinteralia])
74
+ - Fix `FactoryBot/CreateList` autocorrect crashing when the factory is called with a block=. ([@Darhazer])
75
+ - `FactoryBot/CreateList` now ignores `times` blocks with an argument. ([@Darhazer])
76
+ - Fix `FactoryBot/AttributeDefinedStatically` not working when there is a non-symbol key. ([@vzvu3k6k])
77
+ - Fix false negative in `FactoryBot/AttributeDefinedStatically` when attribute is defined on `self`. ([@Darhazer])
78
+ - `RSpec/FactoryBot` cops will now also inspect the `spec/factories.rb` path by default. ([@bquorning])
79
+ - Add `FactoryBot/AttributeDefinedStatically` cop to help FactoryBot users with the deprecation of static attributes. ([@composerinteralia], [@seanpdoyle])
80
+ - Remove `FactoryBot/DynamicAttributeDefinedStatically` and `FactoryBot/StaticAttributeDefinedDynamically` cops. ([@composerinteralia])
81
+ - Fix `FactoryBot/DynamicAttributeDefinedStatically` false positive when using symbol proc argument for a sequence. ([@tdeo])
82
+ - Add `FactoryBot/CreateList` cop. ([@Darhazer])
83
+ - Fix `FactoryBot/StaticAttributeDefinedDynamically` to handle empty block. ([@abrom])
84
+ - Fix false positive in `FactoryBot/DynamicAttributeDefinedStatically` when a before/after callback has a symbol proc argument. ([@abrom])
85
+ - Fix `FactoryBot/DynamicAttributeDefinedStatically` to handle dynamic attributes inside arrays/hashes. ([@abrom])
86
+ - Add `FactoryBot/StaticAttributeDefinedDynamically` (based on dynamic attribute cop). ([@abrom])
87
+ - Rename namespace `FactoryGirl` to `FactoryBot` following original library update. ([@walf443])
88
+ - Add `RSpec/FactoryGirl` namespace including the first cop for factories: `FactoryGirl/DynamicAttributeDefinedStatically`. ([@jonatas])
89
+
90
+ <!-- Contributors (alphabetically) -->
91
+
92
+ [@abrom]: https://github.com/abrom
93
+ [@andrykonchin]: https://github.com/andrykonchin
94
+ [@bquorning]: https://github.com/bquorning
95
+ [@composerinteralia]: https://github.com/composerinteralia
96
+ [@darhazer]: https://github.com/Darhazer
97
+ [@ddieulivol]: https://github.com/ddieulivol
98
+ [@dmitrytsepelev]: https://github.com/dmitrytsepelev
99
+ [@harrylewis]: https://github.com/harrylewis
100
+ [@jaydorsey]: https://github.com/jaydorsey
101
+ [@jfragoulis]: https://github.com/jfragoulis
102
+ [@jonatas]: https://github.com/jonatas
103
+ [@leoarnold]: https://github.com/leoarnold
104
+ [@liberatys]: https://github.com/Liberatys
105
+ [@morissetcl]: https://github.com/morissetcl
106
+ [@ngouy]: https://github.com/ngouy
107
+ [@owst]: https://github.com/owst
108
+ [@pirj]: https://github.com/pirj
109
+ [@r7kamura]: https://github.com/r7kamura
110
+ [@seanpdoyle]: https://github.com/seanpdoyle
111
+ [@tdeo]: https://github.com/tdeo
112
+ [@tejasbubane]: https://github.com/tejasbubane
113
+ [@vzvu3k6k]: https://github.com/vzvu3k6k
114
+ [@walf443]: https://github.com/walf443
115
+ [@ybiquitous]: https://github.com/ybiquitous
116
+ [@ydah]: https://github.com/ydah
@@ -0,0 +1,21 @@
1
+ # The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Ian MacLeod <ian@nevir.net>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
+ of the Software, and to permit persons to whom the Software is furnished to do
10
+ so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,88 @@
1
+ # RuboCop factory_bot
2
+
3
+ [![Join the chat at https://gitter.im/rubocop-rspec/Lobby](https://badges.gitter.im/rubocop-rspec/Lobby.svg)](https://gitter.im/rubocop-rspec/Lobby)
4
+ [![Gem Version](https://badge.fury.io/rb/rubocop-factory_bot.svg)](https://rubygems.org/gems/rubocop-factory_bot)
5
+ ![CI](https://github.com/rubocop/rubocop-factory_bot/workflows/CI/badge.svg)
6
+
7
+ [factory_bot](https://github.com/thoughtbot/factory_bot/blob/main/GETTING_STARTED.md)-specific analysis for your projects, as an extension to
8
+ [RuboCop](https://github.com/rubocop/rubocop).
9
+
10
+ ## Installation
11
+
12
+ Just install the `rubocop-factory_bot` gem
13
+
14
+ ```bash
15
+ gem install rubocop-factory_bot
16
+ ```
17
+
18
+ or if you use bundler put this in your `Gemfile`
19
+
20
+ ```ruby
21
+ gem 'rubocop-factory_bot', require: false
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ You need to tell RuboCop to load the factory_bot extension. There are three
27
+ ways to do this:
28
+
29
+ ### RuboCop configuration file
30
+
31
+ Put this into your `.rubocop.yml`.
32
+
33
+ ```yaml
34
+ require: rubocop-factory_bot
35
+ ```
36
+
37
+ Alternatively, use the following array notation when specifying multiple extensions.
38
+
39
+ ```yaml
40
+ require:
41
+ - rubocop-other-extension
42
+ - rubocop-factory_bot
43
+ ```
44
+
45
+ Now you can run `rubocop` and it will automatically load the RuboCop factory_bot
46
+ cops together with the standard cops.
47
+
48
+ ### Command line
49
+
50
+ ```bash
51
+ rubocop --require rubocop-factory_bot
52
+ ```
53
+
54
+ ### Rake task
55
+
56
+ ```ruby
57
+ RuboCop::RakeTask.new do |task|
58
+ task.requires << 'rubocop-factory_bot'
59
+ end
60
+ ```
61
+
62
+ ## Documentation
63
+
64
+ You can read more about RuboCop factory_bot in its [official manual](https://docs.rubocop.org/rubocop-factory_bot).
65
+
66
+ ## The Cops
67
+
68
+ All cops are located under
69
+ [`lib/rubocop/cop/factory_bot`](lib/rubocop/cop/factory_bot), and contain
70
+ examples/documentation.
71
+
72
+ In your `.rubocop.yml`, you may treat the factory_bot cops just like any other
73
+ cop. For example:
74
+
75
+ ```yaml
76
+ FactoryBot/AttributeDefinedStatically:
77
+ Exclude:
78
+ - spec/factories/my_factory.rb
79
+ ```
80
+
81
+ ## Contributing
82
+
83
+ Checkout the [contribution guidelines](.github/CONTRIBUTING.md).
84
+
85
+ ## License
86
+
87
+ `rubocop-factory_bot` is MIT licensed. [See the accompanying file](MIT-LICENSE.md) for
88
+ the full text.
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2012-23 Bozhidar Batsov
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,97 @@
1
+ # RuboCop Performance
2
+
3
+ [![Gem Version](https://badge.fury.io/rb/rubocop-performance.svg)](https://badge.fury.io/rb/rubocop-performance)
4
+ [![CI](https://github.com/rubocop/rubocop-performance/actions/workflows/test.yml/badge.svg)](https://github.com/rubocop/rubocop-performance/actions/workflows/test.yml)
5
+ [![Discord](https://img.shields.io/badge/chat-on%20discord-7289da.svg?sanitize=true)](https://discord.gg/wJjWvGRDmm)
6
+
7
+ Performance optimization analysis for your projects, as an extension to [RuboCop](https://github.com/rubocop/rubocop).
8
+
9
+ ## Installation
10
+
11
+ Just install the `rubocop-performance` gem
12
+
13
+ ```sh
14
+ $ gem install rubocop-performance
15
+ ```
16
+
17
+ or if you use bundler put this in your `Gemfile`
18
+
19
+ ```ruby
20
+ gem 'rubocop-performance', require: false
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ You need to tell RuboCop to load the Performance extension. There are three
26
+ ways to do this:
27
+
28
+ ### RuboCop configuration file
29
+
30
+ Put this into your `.rubocop.yml`.
31
+
32
+ ```yaml
33
+ require: rubocop-performance
34
+ ```
35
+
36
+ Alternatively, use the following array notation when specifying multiple extensions.
37
+
38
+ ```yaml
39
+ require:
40
+ - rubocop-other-extension
41
+ - rubocop-performance
42
+ ```
43
+
44
+ Now you can run `rubocop` and it will automatically load the RuboCop Performance
45
+ cops together with the standard cops.
46
+
47
+ ### Command line
48
+
49
+ ```sh
50
+ $ rubocop --require rubocop-performance
51
+ ```
52
+
53
+ ### Rake task
54
+
55
+ ```ruby
56
+ require 'rubocop/rake_task'
57
+
58
+ RuboCop::RakeTask.new do |task|
59
+ task.requires << 'rubocop-performance'
60
+ end
61
+ ```
62
+
63
+ ## The Cops
64
+
65
+ All cops are located under
66
+ [`lib/rubocop/cop/performance`](lib/rubocop/cop/performance), and contain
67
+ examples/documentation.
68
+
69
+ In your `.rubocop.yml`, you may treat the Performance cops just like any other
70
+ cop. For example:
71
+
72
+ ```yaml
73
+ Performance/Size:
74
+ Exclude:
75
+ - lib/example.rb
76
+ ```
77
+
78
+ ## Documentation
79
+
80
+ You can read a lot more about RuboCop Performance in its [official docs](https://docs.rubocop.org/rubocop-performance/).
81
+
82
+ ## Compatibility
83
+
84
+ RuboCop Performance complies with the RuboCop core compatibility.
85
+
86
+ See the [compatibility documentation](https://docs.rubocop.org/rubocop/compatibility.html) for further details.
87
+
88
+ **Note:** Performance cops are all MRI focused and are highly dependent of the version of MRI you're using.
89
+
90
+ ## Contributing
91
+
92
+ Checkout the [contribution guidelines](CONTRIBUTING.md).
93
+
94
+ ## License
95
+
96
+ `rubocop-performance` is MIT licensed. [See the accompanying file](LICENSE.txt) for
97
+ the full text.