派生自
gitlab-cn / GitLab
34410 提交 落后, 2 提交 领先 上游代码库。
-
由 Peter Leitzen 创作于
The major changes here are: 1. Inherit from `RuboCop::Cop::Base`, not `RuboCop::Cop::Cop`. 2. New auto-correction style - `extend RuboCop::Cop::AutoCorrector`, pass a block to `add_offense` rather than defining an `autocorrect` method. 3. `add_offense` no longer takes a `location` keyword argument. 4. Specs should not set `subject(:cop)` as that will be done automatically, and will use the config correctly.
由 Peter Leitzen 创作于The major changes here are: 1. Inherit from `RuboCop::Cop::Base`, not `RuboCop::Cop::Cop`. 2. New auto-correction style - `extend RuboCop::Cop::AutoCorrector`, pass a block to `add_offense` rather than defining an `autocorrect` method. 3. `add_offense` no longer takes a `location` keyword argument. 4. Specs should not set `subject(:cop)` as that will be done automatically, and will use the config correctly.
code_reuse_helpers.rb 5.35 KiB