Giter Site home page Giter Site logo

More cops(rules) about rubocop HOT 17 CLOSED

rubocop avatar rubocop commented on May 22, 2024
More cops(rules)

from rubocop.

Comments (17)

jonas054 avatar jonas054 commented on May 22, 2024

I want to do "Use only ascii symbols in identifiers and comments". The list is a great idea, by the way.

from rubocop.

bbatsov avatar bbatsov commented on May 22, 2024

It's yours then.

from rubocop.

jdanielnd avatar jdanielnd commented on May 22, 2024

I've written a cop for "Prefer %w to the literal array syntax when you need an array of strings." and now it detects that style rule on various code files from the project. Should I correct them to match this new rule too?

from rubocop.

bolandrm avatar bolandrm commented on May 22, 2024

This can be crossed off the list:

  • Avoid methods longer than 10 LOC (lines of code). Ideally, most methods will be shorter than 5 LOC. Empty lines do not contribute to the relevant LOC. (this cop should have configurable max length)

I'm going to work on "When using reduce with short blocks, name the arguments |a, e|"

from rubocop.

bbatsov avatar bbatsov commented on May 22, 2024

I guess I crossed it off just as you were typing this comment. :-)

Great, looking forward to it.

from rubocop.

jonas054 avatar jonas054 commented on May 22, 2024

I'll do "Use %r only for regular expressions matching more than one '/' character".

from rubocop.

emou avatar emou commented on May 22, 2024

I'll look into "Avoid more than three levels of block nesting."

from rubocop.

bbatsov avatar bbatsov commented on May 22, 2024

Great, @emou. I'd suggest to actually use a customizable param for that particular check(instead of hardcoding 3), since a lot of people might disagree with the number prescribed by default.

from rubocop.

bbatsov avatar bbatsov commented on May 22, 2024

I'll do 'Favor %r if you have more than 1 '/' characters in your regexp'.

from rubocop.

jurriaan avatar jurriaan commented on May 22, 2024

What do you think about an indentation Cop?

ps. Could you use a task list? I think that's more clear.

from rubocop.

bbatsov avatar bbatsov commented on May 22, 2024

Yep, that would be a great addition. The ruby interpreter detect misaligned ends, but nothing more than that. An indentation cop would be an awesome addition. Do you volunteer to write it? :-)

ps. Will do!

from rubocop.

bbatsov avatar bbatsov commented on May 22, 2024

Done.

from rubocop.

bbatsov avatar bbatsov commented on May 22, 2024

@jonas054 @yujinakayama I think we should try to wrap this issue before 1.0. I'd suggest we continue the old practice of doing a cop at time until we're out of cops. I'll start with the unneeded return check.

from rubocop.

jonas054 avatar jonas054 commented on May 22, 2024

I'll do Avoid self where not required.

from rubocop.

bbatsov avatar bbatsov commented on May 22, 2024

I'll do the implicit begin next.

from rubocop.

jonas054 avatar jonas054 commented on May 22, 2024

I'll do "Comment annotation should be all upper case and at the beginning of the comment".

from rubocop.

jonas054 avatar jonas054 commented on May 22, 2024

I'll do "Prefer modules to classes with only class methods" next.

from rubocop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.