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 offenses for RuboCop that can be fixed automatically #1406

Merged
merged 7 commits into from Jan 5, 2023

Conversation

ydah
Copy link
Contributor

@ydah ydah commented Nov 20, 2022

This PR fix offenses for RuboCop that can be fixed automatically.
The automatic modification performed in this PR is performed by rubocop -a.

In the process, I also implement the following:


Removed RuboCop version specification so that the latest RuboCop can be used.

This is because using the latest version will prevent false positive offenses and erroneous automatic corrections.


The newly added cops is not currently working.

This is because the purpose of this PR is to address the current violations of RuboCop, not the newly added cops.

Ref: https://docs.rubocop.org/rubocop/versioning.html#enablingdisabling-pending-cops-in-bulk


Add inherit_mode for merge: Exclude.

The following warnings have been addressed:

`Lint/UselessAssignment: Exclude` in `.rubocop.yml` overrides a generated `Exclude` in `.rubocop_todo.yml`. Either remove `Lint/UselessAssignment: Exclude` or add `inherit_mode: merge: - Exclude`.
Created .rubocop_todo.yml.

For those that cannot be modified automatically, they are once put into todo status in .rubocop_todo.yml.
I would like to check these as well if this PR is merged.

@@ -46,7 +46,7 @@ def self.instance_name

def initialize(dangerfile)
super(dangerfile)
raise unless dangerfile.env.scm.instance_of?(Danger::GitRepo)
raise unless dangerfile.env.scm.class == Danger::GitRepo # rubocop:disable Style/ClassEqualityComparison
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressing this offense would change the behavior.
It actually causes the test to fail, so it is disabled: https://github.com/danger/danger/actions/runs/3508633313/jobs/5877172874

```
`Lint/UselessAssignment: Exclude` in `.rubocop.yml` overrides a generated `Exclude` in `.rubocop_todo.yml`. Either remove `Lint/UselessAssignment: Exclude` or add `inherit_mode: merge: - Exclude`.
Created .rubocop_todo.yml.
```
@orta
Copy link
Member

orta commented Jan 5, 2023

Looks good to me, given it a few reads though and everything seems reasonable to me- thanks (sorry for the months of delay!)

@orta orta merged commit dd2a883 into danger:master Jan 5, 2023
@ydah ydah deleted the fix/rubocop-warnings branch January 5, 2023 16:12
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

3 participants