Skip to content

Instantly share code, notes, and snippets.

@r7kamura
Last active September 25, 2020 19:13
Show Gist options
  • Save r7kamura/5d39cd15ade28981a946b12f810740ed to your computer and use it in GitHub Desktop.
Save r7kamura/5d39cd15ade28981a946b12f810740ed to your computer and use it in GitHub Desktop.
A Ruby script to print cop names which include "space".
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'activesupport'
gem 'rubocop', '0.84.0'
gem 'rubocop-performance', '1.6.0'
gem 'rubocop-rails', '2.5.2'
end
require 'active_support/core_ext/class/subclasses'
require 'rubocop'
require 'rubocop/performance'
require 'rubocop/rails'
puts RuboCop::Cop::Cop.descendants.map(&:to_s).grep(/space/i).sort
@r7kamura
Copy link
Author

r7kamura commented Sep 25, 2020

RuboCop::Cop::Layout::LeadingCommentSpace
RuboCop::Cop::Layout::SpaceAfterColon
RuboCop::Cop::Layout::SpaceAfterComma
RuboCop::Cop::Layout::SpaceAfterMethodName
RuboCop::Cop::Layout::SpaceAfterNot
RuboCop::Cop::Layout::SpaceAfterSemicolon
RuboCop::Cop::Layout::SpaceAroundBlockParameters
RuboCop::Cop::Layout::SpaceAroundEqualsInParameterDefault
RuboCop::Cop::Layout::SpaceAroundKeyword
RuboCop::Cop::Layout::SpaceAroundMethodCallOperator
RuboCop::Cop::Layout::SpaceAroundOperators
RuboCop::Cop::Layout::SpaceBeforeBlockBraces
RuboCop::Cop::Layout::SpaceBeforeComma
RuboCop::Cop::Layout::SpaceBeforeComment
RuboCop::Cop::Layout::SpaceBeforeFirstArg
RuboCop::Cop::Layout::SpaceBeforeSemicolon
RuboCop::Cop::Layout::SpaceInLambdaLiteral
RuboCop::Cop::Layout::SpaceInsideArrayLiteralBrackets
RuboCop::Cop::Layout::SpaceInsideArrayPercentLiteral
RuboCop::Cop::Layout::SpaceInsideBlockBraces
RuboCop::Cop::Layout::SpaceInsideHashLiteralBraces
RuboCop::Cop::Layout::SpaceInsideParens
RuboCop::Cop::Layout::SpaceInsidePercentLiteralDelimiters
RuboCop::Cop::Layout::SpaceInsideRangeLiteral
RuboCop::Cop::Layout::SpaceInsideReferenceBrackets
RuboCop::Cop::Layout::SpaceInsideStringInterpolation
RuboCop::Cop::Layout::TrailingWhitespace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment