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

Update rubocop #22

Merged
merged 4 commits into from
Jul 18, 2022
Merged

Update rubocop #22

merged 4 commits into from
Jul 18, 2022

Conversation

whereismyjetpack
Copy link
Contributor

updates rubocop for ruby 3 support.

@whereismyjetpack
Copy link
Contributor Author

@ajkiessl -- this is ready to go. Let me know if there's anything I can do.

exe/niftany Outdated
@@ -10,7 +10,7 @@ require 'scss_lint/cli'
require 'colorize'

def parse_opts(args)
options = OpenStruct.new
options = Struct.new
Copy link
Contributor

@ajkiessl ajkiessl Jul 18, 2022

Choose a reason for hiding this comment

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

@whereismyjetpack Getting this error here when I try to run niftany:

13:in 'new': wrong number of arguments (given 0, expected 1+) (ArgumentError)

Is OpenStruct deprecated?

Copy link
Contributor

Choose a reason for hiding this comment

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

It works with OpenStruct.new

Copy link
Contributor Author

Choose a reason for hiding this comment

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

rubocop was barking at me for using OpenStruct. I'll have to find a way around this, sorry!

Copy link
Contributor

Choose a reason for hiding this comment

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

I think maybe it should be:

  options = Struct.new(auto_correct: false, parallel: false)

I'm testing this out now

Edit: Hmm this seems to work: options = Struct.new('Options', :auto_correct, :parallel).new

Copy link
Contributor

@ajkiessl ajkiessl left a comment

Choose a reason for hiding this comment

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

Also, I'm getting a deprecation message for the --auto-correct rubocop flag. It should be --autocorrect. So these need to be changed:

rubocop_options.append('--auto-correct') if options.auto_correct

rubocop_options.append('--auto-correct') if options.auto_correct

exe/niftany Outdated
@@ -10,7 +10,7 @@ require 'scss_lint/cli'
require 'colorize'

def parse_opts(args)
options = OpenStruct.new
options = Struct.new
Copy link
Contributor

Choose a reason for hiding this comment

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

I think maybe it should be:

  options = Struct.new(auto_correct: false, parallel: false)

I'm testing this out now

Edit: Hmm this seems to work: options = Struct.new('Options', :auto_correct, :parallel).new

@ajkiessl ajkiessl merged commit 382fd44 into main Jul 18, 2022
@ajkiessl ajkiessl deleted the update-rubocop branch July 18, 2022 15:57
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