Giter Club home page Giter Club logo

ramsey-cop's People

Contributors

breese524 avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar ethan-dowler avatar jasonyork avatar jlw avatar jongallion avatar jwsloan avatar mellowfish avatar pmgower avatar rickpeyton avatar rileymathews avatar sauderrs avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ramsey-cop's Issues

Style/NumericLiterals

References:
https://rubocop.readthedocs.io/en/latest/cops_style/
https://github.com/lampo/dev-standards/blob/e9b96354eb81c4ea4e7ce9de4d890ba7d063547a/ruby/coding_standards/01_source_code_layout.md#underscores-in-numerics

The default is to require the underscores for any number with 5 or more digits. As can be seen here, this affects postal codes.

Do we use this cop and set the min to 6 to avoid postal codes?
Do we suggest postal codes be set as strings instead of integers, and leave it at 5?
Do we turn it off altogether?

Discuss: Increase line length

Our team had an internal rule for 120 characters that seemed easy to live by, but I am finding that 100 feels cramped (especially for slightly too-long string literals).

Anyone have thoughts on this?

Add rubocop-rails as a dependancy

Expected Behavior

  • ramsey-cop will lint my rails code

Actual Behavior

  • rubocop no longer lints rails code by default; you have to add rubocop-rails

Steps to Reproduce Behavior

  • install ramsey-cop gem

Screen Shot 2019-07-01 at 12 48 59 PM

Specifications

(e.g. versions, operating system, hardware, etc.)

Favor double quotes over single quotes

Our standards say that we should always favor double quotes over single quotes. Should this be the case? Shouldn't we only favor double quotes if we're doing interpolation?

Layout/ExtraSpacing

Layout/ExtraSpacing:

  • AllowForAlignment: true
    • When true, allows most uses of extra spacing if the intent is to align things with the previous or next line, not counting empty lines or comment lines.
  • ForceEqualSignAlignment: false
    • When true, forces the alignment of = in assignments on consecutive lines.

👍

foo = bar
some_other_foo = a_different_bar

❤️

foo            = bar
some_other_foo = a_different_bar

👎

foo =            bar
some_other_foo = a_different_bar

Length Metrics/{Block/Class/Method/Module}Length

Metrics/BlockLength:
CountComments: false # count full line comments?
Max: 25

Metrics/ClassLength:
CountComments: false # count full line comments?
Max: 100

Metrics/MethodLength:
CountComments: false # count full line comments?
Max: 10

Metrics/ModuleLength:
CountComments: false # count full line comments?
Max: 100

Discuss adjusting Metrics/MethodLength and Metrics/AbcSize

The current MethodLength (max 10) and AbcSize (max 15), which come from Rubocop's default settings, seem quite low. For projects that enforce that all checks pass, it feels like these two are creating a perverse incentive to break code apart in potentially unhelpful ways.

I'd like to discuss increasing these to a potentially higher value. I welcome your constructive observations, objections, and suggestions.

Gem documentation process (repo vs wiki)

I have two documents I want to add to this repo

Introducing RamseyCop to an existing repository
Using VIM, RamseyCop and Asynchronous Lint Engine

I was just going to add a couple of .md files in the repo, but then I started to question that.

  • This could be considered secondary documentation. Should we have a supporting documentation directory?
  • Should we instead use the Wiki for this kind of documentation?
  • How do we decide what is worth being in the repo versus in the wiki?
  • Is it important to us for this kind of documentation to go through a PR process?

I brought this up to @jwsloan and he had a great question

How [would we] do this if it were open sourced?

@lampo/ruby-miners

Require frozen string literals

Should we require the magic comment to freeze string literals?
# frozen_string_literal: true

Presumably this will not be necessary when we begin using Ruby 3.0.

👍 for yes (continue with the default setting), 👎 for no (change the default setting)

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.