Skip to content

Fix offenses for RuboCop that can be fixed automatically#1406

Merged
orta merged 7 commits into
danger:masterfrom
ydah:fix/rubocop-warnings
Jan 5, 2023
Merged

Fix offenses for RuboCop that can be fixed automatically#1406
orta merged 7 commits into
danger:masterfrom
ydah:fix/rubocop-warnings

Conversation

@ydah

@ydah ydah commented Nov 20, 2022

Copy link
Copy Markdown
Contributor

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.

@ydah ydah force-pushed the fix/rubocop-warnings branch from ef6798a to f39b009 Compare November 20, 2022 15:55
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
Copy Markdown
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

ydah added 7 commits November 22, 2022 18:17
```
`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.
```
@ydah ydah force-pushed the fix/rubocop-warnings branch from f39b009 to 573d46c Compare November 22, 2022 09:24
@orta

orta commented Jan 5, 2023

Copy link
Copy Markdown
Member

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.

3 participants