ramseyinhouse / ramsey-cop Goto Github PK
View Code? Open in Web Editor NEWStandardizes major version and style overrides for Rubocop gem
License: Other
Standardizes major version and style overrides for Rubocop gem
License: Other
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?
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?
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:
=
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
Apparently the community likes to indent access modifiers. I like having them unindented. Thoughts?
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
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.
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.
Wiki
for this kind of documentation?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
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.