Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@spotlightishere
Copy link
Member

@spotlightishere spotlightishere commented Nov 17, 2021

A newer version of rubocop requests further changes.
Since we're in the mist of rewriting a few components, I chose to adapt Yuuki's existing config and disable Metrics/BlockNesting, Metrics/ClassLength, and Lint/SelfAssignment until we can properly deal with them. Additionally, the maximum line limit was increased to 130.

This style looks alright to me - should we aim to have any other specific style changes throughout rewriting?

RuboCop output suppressed after previous changes
> rubocop -a
Inspecting 6 files
....W.

Offenses:

lib/commandrb.rb:218:101: C: Layout/LineLength: Line is too long. [121/100]
          if !(command[:max_args].nil? || failed) && ((command[:max_args]).positive? && args.length > command[:max_args])
                                                                                                    ^^^^^^^^^^^^^^^^^^^^^
lib/commandrb.rb:229:101: C: Layout/LineLength: Line is too long. [121/100]
          if !(command[:min_args].nil? || failed) && ((command[:min_args]).positive? && args.length < command[:min_args])
                                                                                                    ^^^^^^^^^^^^^^^^^^^^^
lib/commandrb.rb:278:17: C: Metrics/BlockNesting: Avoid more than 3 levels of block nesting.
                if send_error.nil? ...
                ^^^^^^^^^^^^^^^^^^
lib/commandrb.rb:294:11: W: Lint/SelfAssignment: Self-assignment detected.
          command = command
          ^^^^^^^^^^^^^^^^^
lib/commandrb.rb:295:11: W: Lint/SelfAssignment: Self-assignment detected.
          event = event
          ^^^^^^^^^^^^^
lib/commandrb.rb:296:11: W: Lint/SelfAssignment: Self-assignment detected.
          args = args
          ^^^^^^^^^^^
lib/commandrb.rb:297:11: W: Lint/SelfAssignment: Self-assignment detected.
          rawargs = rawargs
          ^^^^^^^^^^^^^^^^^

6 files inspected, 7 offenses detected

@Erisa
Copy link
Member

Erisa commented Nov 17, 2021

Honestly I would rather not tempt fate by changing the style or structure of commandrb, the changes you made are fine but I would be more willing to replace it entirely than to dredge through and update it to whatever styling rubocop demands.
Commandrb is treated very much as a legacy components, we only want to modify it as much as is necessary for operation.

Copy link
Member

@Erisa Erisa left a comment

Choose a reason for hiding this comment

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

LGTM as-is

@Erisa Erisa merged commit 44f3c85 into main Nov 18, 2021
@spotlightishere spotlightishere deleted the spotlight/tame-rubocop branch November 18, 2021 00:05
spotlightishere added a commit that referenced this pull request Jul 14, 2022
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.

2 participants