toptal / active-job-style-guide

This Background Jobs style guide is a list of best practices working with Ruby background jobs.
471 stars 20 forks source link

Rubocop extension #6

Closed tejasbubane closed 1 year ago

tejasbubane commented 3 years ago

Thanks for this styleguide. I learnt a few good practices and sidekiq's features.

Does rubocop extension corresponding this style-guide already exist somewhere? I could not find any mentioned in this guide, nor in the rubocop docs.

I am planning to create such extension. Not all rules can be checked by rubocop, but some sure can and that would be helpful. I thought of checking with maintainers here before creating the new extension to avoid duplicate work.

pirj commented 3 years ago

There were a few internal cops as far as I remember.

  1. Models as arguments. As I recall, it was prone to false positives. E.g. stripe_id is not an id of a Stripe model.
  2. Queue assignments. Quite useful.

@bbatsov Are there any plans to make those cops available to the public?

I am planning to create such extension

Fantastic!

There's also this bag of notes if you're up to extend the guide itself.

On a side note, I don't have enough capacity to continue building and contributing to this guide myself, but I'll be happy to maintain it under @rubocop organization.

pirj commented 1 year ago

An extension exists it turns out https://github.com/dvandersluis/rubocop-sidekiq/ thanks to @dvandersluis I'll close this as completed.