Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix an obsolete option configuration values are duplicated when generating .rubocop_todo.yml #10875

Merged
merged 1 commit into from Aug 6, 2022

Conversation

ydah
Copy link
Member

@ydah ydah commented Aug 6, 2022

Create two files with the following code:

def fooBar; end

Set the following in .rubocop.yml:

Style/MethodName:
  IgnoredPatterns:
    - pattern1
    - pattern2

Run rubocop --auto-gen-config
Then duplicate configuration values are enumerated in .rubocop_todo.yml as follows:

# Offense count: 2
# Configuration parameters: EnforcedStyle, AllowedPatterns, IgnoredPatterns.
# SupportedStyles: snake_case, camelCase
# AllowedPatterns: pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2
Naming/MethodName:
  Exclude:
    - 'test1.rb'
    - 'test2.rb'

Before submitting the PR make sure the following are checked:

  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences.
  • Wrote good commit messages.
  • [-] Commit message starts with [Fix #issue-number] (if the related issue exists).
  • Feature branch is up-to-date with master (if not - rebase it).
  • Squashed related commits together.
  • Added tests.
  • Ran bundle exec rake default. It executes all tests and runs RuboCop on its own code.
  • Added an entry (file) to the changelog folder named {change_type}_{change_description}.md if the new code introduces user-observable changes. See changelog entry format for details.

@ydah ydah requested a review from koic August 6, 2022 03:08
@ydah ydah requested a review from koic August 6, 2022 03:28
…ating `.rubocop_todo.yml`

Create two files with the following code:
```ruby
def fooBar; end
```

Set the following in .rubocop.yml:
```yml
Style/MethodName:
  IgnoredPatterns:
    - pattern1
    - pattern2
```

Run `rubocop --auto-gen-config`
Then duplicate configuration values are enumerated in `.rubocop_todo.yml` as follows:
```yml
# Offense count: 2
# Configuration parameters: EnforcedStyle, AllowedPatterns, IgnoredPatterns.
# SupportedStyles: snake_case, camelCase
# AllowedPatterns: pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2, pattern1, pattern2
Naming/MethodName:
  Exclude:
    - 'test1.rb'
    - 'test2.rb'
```
@ydah ydah requested a review from koic August 6, 2022 04:16
@koic koic merged commit 265a9e6 into rubocop:master Aug 6, 2022
@koic
Copy link
Member

koic commented Aug 6, 2022

Thanks!

@ydah ydah deleted the fix/duplicate_parameter branch August 6, 2022 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants