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 rubocop-rspec warnings for RSpec/AnyInstance and RSpec/InstanceVariable #846

Open
denny opened this issue Jan 9, 2021 · 6 comments
Open
Labels
code quality Primarily about code quality metrics (rather than deeper refactoring) good first issue This issue should be suitable for less experienced developers help offered I would be very happy to help less experienced developers tackle this issue (advice/pairing/etc) main app DEPRECATED: main_app before the core plugin refactor (was: 'core' stuff that isn't in plugins) plugin DEPRECATED: split into core/features/support (was: about a plugin or the code that supports them) tests Tests and test infrastructure (CI, etc)

Comments

@denny
Copy link
Owner

denny commented Jan 9, 2021

Currently there are two categories of warning from rubocop-rspec which have not been fixed:

  • 24 warnings for RSpec/AnyInstance, spread across 6 files (all request specs)

  • 245 195 135 warnings for RSpec/InstanceVariable, spread across 15 10 5 files (a mixture of shared examples, model specs, mailer specs, and request specs)

@denny denny added good first issue This issue should be suitable for less experienced developers plugin DEPRECATED: split into core/features/support (was: about a plugin or the code that supports them) tests Tests and test infrastructure (CI, etc) main app DEPRECATED: main_app before the core plugin refactor (was: 'core' stuff that isn't in plugins) code quality Primarily about code quality metrics (rather than deeper refactoring) help offered I would be very happy to help less experienced developers tackle this issue (advice/pairing/etc) labels Jan 9, 2021
@denny
Copy link
Owner Author

denny commented Jan 9, 2021

If you're interested in tackling these warnings, the relevant filenames are in the .rubocop_todo.yml file, and the links in the issue have more information about each type of warning and how to fix it.

If you are a less experienced developer who is looking at this issue and thinking you'd like to try to take it on but you're not entirely confident, please get in touch - I would be happy to help you get set up, or have a more detailed discussion about what needs doing, or even pair with you on the coding itself. 🙂

In my day job I'm a lead developer who often mentors less experienced developers, and I'd love to use some of that experience to help people take their first steps into contributing to open source projects.

@haleydek
Copy link

I'd be happy to tackle these rubocop-rspec warnings this week!

@denny
Copy link
Owner Author

denny commented Jan 16, 2021

I'd be happy to tackle these rubocop-rspec warnings this week!

That'd be great, thanks @haleydek! I particularly look forward to learning how I should have done the ones that use allow_any_instance_of 😃

@denny
Copy link
Owner Author

denny commented Feb 22, 2021

Some progress on this during the core plugin refactoring recently; it's now down to 195 warnings for RSpec/InstanceVariable (and still 24 for RSpec/AnyInstance).

@denny
Copy link
Owner Author

denny commented Feb 27, 2021

Ground my way through a few more of the instance variable warnings; down from 195 to 135 warnings now, and down from 10 files to 5.

If anybody else is interested in picking this task up , you can see the kind of changes that I've been making to get rid of this particular warning here: #961

Still no idea how to tackle the AnyInstanceOf ones, mind you. 😝

@denny
Copy link
Owner Author

denny commented Feb 27, 2021

@haleydek, are you still around? Anything I can do to help you get started on the rest of these, if you're still interested? No problem if you're busy or whatever, of course, just thought I'd offer while the ones I just did are fresh in my mind 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code quality Primarily about code quality metrics (rather than deeper refactoring) good first issue This issue should be suitable for less experienced developers help offered I would be very happy to help less experienced developers tackle this issue (advice/pairing/etc) main app DEPRECATED: main_app before the core plugin refactor (was: 'core' stuff that isn't in plugins) plugin DEPRECATED: split into core/features/support (was: about a plugin or the code that supports them) tests Tests and test infrastructure (CI, etc)
Projects
None yet
Development

No branches or pull requests

2 participants