Skip to content

Commit

Permalink
Revert "Mark Cops and Formatters as private"
Browse files Browse the repository at this point in the history
This reverts commit 90d5333.

I was late to participate in the discussion below.
#8501

Cop names are specified by users to .rubocop.yml, `--only`
option, and etc. IMHO, the names and behaviors cannot be
changed without impacting users.

Users should refrain from depend on it as an implementation API,
but I don't think it's hidden from users.
  • Loading branch information
koic authored and bbatsov committed Sep 1, 2020
1 parent f69a7a8 commit 6d781b0
Show file tree
Hide file tree
Showing 448 changed files with 0 additions and 767 deletions.
2 changes: 0 additions & 2 deletions lib/rubocop/cop/bundler/duplicated_gem.rb
Expand Up @@ -25,8 +25,6 @@ module Bundler
#
# # good
# gem 'rubocop', groups: [:development, :test]
#
# @api private
class DuplicatedGem < Cop
include RangeHelp

Expand Down
1 change: 0 additions & 1 deletion lib/rubocop/cop/bundler/gem_comment.rb
Expand Up @@ -58,7 +58,6 @@ module Bundler
# # Version 2.1 introduces breaking change baz
# gem 'bar', '< 2.1'
#
# @api private
class GemComment < Cop
include DefNode

Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/bundler/insecure_protocol_source.rb
Expand Up @@ -25,8 +25,6 @@ module Bundler
# # good
# source 'https://rubygems.org' # strongly recommended
# source 'http://rubygems.org'
#
# @api private
class InsecureProtocolSource < Base
include RangeHelp
extend AutoCorrector
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/bundler/ordered_gems.rb
Expand Up @@ -24,8 +24,6 @@ module Bundler
# gem 'rubocop'
# # For tests
# gem 'rspec'
#
# @api private
class OrderedGems < Cop
include ConfigurableEnforcedStyle
include OrderedGemNode
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/cop.rb
Expand Up @@ -8,8 +8,6 @@ module Cop
# @deprecated Use Cop::Base instead
# Legacy scaffold for Cops.
# See https://docs.rubocop.org/rubocop/cop_api_v1_changelog.html
#
# @api private
class Cop < Base
attr_reader :offenses

Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/gemspec/duplicated_assignment.rb
Expand Up @@ -34,8 +34,6 @@ module Gemspec
# spec.add_runtime_dependency('parallel', '~> 1.10')
# spec.add_runtime_dependency('parser', '>= 2.3.3.1', '< 3.0')
# end
#
# @api private
class DuplicatedAssignment < Cop
include RangeHelp

Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/gemspec/ordered_dependencies.rb
Expand Up @@ -50,8 +50,6 @@ module Gemspec
# spec.add_dependency 'rubocop'
# # For tests
# spec.add_dependency 'rspec'
#
# @api private
class OrderedDependencies < Cop
include ConfigurableEnforcedStyle
include OrderedGemNode
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/gemspec/required_ruby_version.rb
Expand Up @@ -45,8 +45,6 @@ module Gemspec
# Gem::Specification.new do |spec|
# spec.required_ruby_version = '~> 2.5'
# end
#
# @api private
class RequiredRubyVersion < Cop
include RangeHelp

Expand Down
1 change: 0 additions & 1 deletion lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb
Expand Up @@ -25,7 +25,6 @@ module Gemspec
# spec.add_runtime_dependency 'gem_a'
# end
#
# @api private
class RubyVersionGlobalsUsage < Cop
MSG = 'Do not use `RUBY_VERSION` in gemspec file.'

Expand Down
1 change: 0 additions & 1 deletion lib/rubocop/cop/internal_affairs/method_name_equal.rb
Expand Up @@ -12,7 +12,6 @@ module InternalAffairs
# # good
# node.method?(:do_something)
#
# @api private
class MethodNameEqual < Base
include RangeHelp
extend AutoCorrector
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/internal_affairs/node_destructuring.rb
Expand Up @@ -15,8 +15,6 @@ module InternalAffairs
#
# # good
# method_name = send_node.method_name
#
# @api private
class NodeDestructuring < Base
MSG = 'Use the methods provided with the node extensions instead ' \
'of manually destructuring nodes.'
Expand Down
1 change: 0 additions & 1 deletion lib/rubocop/cop/internal_affairs/node_type_predicate.rb
Expand Up @@ -13,7 +13,6 @@ module InternalAffairs
# # good
# node.send_type?
#
# @api private
class NodeTypePredicate < Base
extend AutoCorrector

Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/internal_affairs/offense_location_keyword.rb
Expand Up @@ -13,8 +13,6 @@ module InternalAffairs
#
# # good
# add_offense(node, location: :selector)
#
# @api private
class OffenseLocationKeyword < Base
extend AutoCorrector

Expand Down
Expand Up @@ -16,7 +16,6 @@ module InternalAffairs
# add_offense(node)
# add_offense(node, location: :selector)
#
# @api private
class RedundantLocationArgument < Base
include RangeHelp
extend AutoCorrector
Expand Down
Expand Up @@ -19,7 +19,6 @@ module InternalAffairs
# add_offense(node, message: CUSTOM_MSG)
# add_offense(node, message: message(other_node))
#
# @api private
class RedundantMessageArgument < Base
include RangeHelp
extend AutoCorrector
Expand Down
Expand Up @@ -13,7 +13,6 @@ module InternalAffairs
# # good
# expect(cop.messages).to eq(['Do not write bad code like that.'])
#
# @api private
class UselessMessageAssertion < Base
MSG = 'Do not specify cop behavior using `described_class::MSG`.'

Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/access_modifier_indentation.rb
Expand Up @@ -32,8 +32,6 @@ module Layout
# private
# def smooth; end
# end
#
# @api private
class AccessModifierIndentation < Cop
include Alignment
include ConfigurableEnforcedStyle
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/argument_alignment.rb
Expand Up @@ -37,8 +37,6 @@ module Layout
#
# foo :bar,
# :baz
#
# @api private
class ArgumentAlignment < Cop
include Alignment

Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/array_alignment.rb
Expand Up @@ -33,8 +33,6 @@ module Layout
#
# array = [1, 2, 3,
# 4, 5, 6]
#
# @api private
class ArrayAlignment < Cop
include Alignment

Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/assignment_indentation.rb
Expand Up @@ -21,8 +21,6 @@ module Layout
#
# The indentation of the remaining lines can be corrected with
# other cops such as `IndentationConsistency` and `EndAlignment`.
#
# @api private
class AssignmentIndentation < Cop
include CheckAssignment
include Alignment
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/block_alignment.rb
Expand Up @@ -61,8 +61,6 @@ module Layout
# .each do
# baz
# end
#
# @api private
class BlockAlignment < Base
include ConfigurableEnforcedStyle
include RangeHelp
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/block_end_newline.rb
Expand Up @@ -24,8 +24,6 @@ module Layout
# blah { |i|
# foo(i)
# }
#
# @api private
class BlockEndNewline < Cop
include Alignment

Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/case_indentation.rb
Expand Up @@ -67,8 +67,6 @@ module Layout
# else
# y / 3
# end
#
# @api private
class CaseIndentation < Base
include Alignment
include ConfigurableEnforcedStyle
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/class_structure.rb
Expand Up @@ -133,8 +133,6 @@ module Layout
# end
#
# @see https://rubystyle.guide#consistent-classes
#
# @api private
class ClassStructure < Base
include VisibilityHelp
extend AutoCorrector
Expand Down
1 change: 0 additions & 1 deletion lib/rubocop/cop/layout/closing_heredoc_indentation.rb
Expand Up @@ -46,7 +46,6 @@ module Layout
# Hi
# EOS
#
# @api private
class ClosingHeredocIndentation < Base
include Heredoc
extend AutoCorrector
Expand Down
1 change: 0 additions & 1 deletion lib/rubocop/cop/layout/closing_parenthesis_indentation.rb
Expand Up @@ -68,7 +68,6 @@ module Layout
# )
#
#
# @api private
class ClosingParenthesisIndentation < Cop
include Alignment

Expand Down
1 change: 0 additions & 1 deletion lib/rubocop/cop/layout/comment_indentation.rb
Expand Up @@ -32,7 +32,6 @@ module Layout
# true
# end
#
# @api private
class CommentIndentation < Cop
include Alignment

Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/condition_position.rb
Expand Up @@ -22,8 +22,6 @@ module Layout
# if some_condition
# do_something
# end
#
# @api private
class ConditionPosition < Base
include RangeHelp
extend AutoCorrector
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/def_end_alignment.rb
Expand Up @@ -33,8 +33,6 @@ module Layout
#
# private def foo
# end
#
# @api private
class DefEndAlignment < Base
include EndKeywordAlignment
include RangeHelp
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/dot_position.rb
Expand Up @@ -22,8 +22,6 @@ module Layout
# # good
# something.
# method
#
# @api private
class DotPosition < Base
include ConfigurableEnforcedStyle
extend AutoCorrector
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/else_alignment.rb
Expand Up @@ -29,8 +29,6 @@ module Layout
# else
# code
# end
#
# @api private
class ElseAlignment < Cop
include EndKeywordAlignment
include Alignment
Expand Down
1 change: 0 additions & 1 deletion lib/rubocop/cop/layout/empty_comment.rb
Expand Up @@ -60,7 +60,6 @@ module Layout
# class Foo
# end
#
# @api private
class EmptyComment < Base
include RangeHelp
extend AutoCorrector
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/empty_line_after_guard_clause.rb
Expand Up @@ -35,8 +35,6 @@ module Layout
# return if need_return?
# end
# end
#
# @api private
class EmptyLineAfterGuardClause < Base
include RangeHelp
extend AutoCorrector
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/empty_line_after_magic_comment.rb
Expand Up @@ -20,8 +20,6 @@ module Layout
# class Person
# # Some code
# end
#
# @api private
class EmptyLineAfterMagicComment < Base
include RangeHelp
extend AutoCorrector
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/empty_line_between_defs.rb
Expand Up @@ -29,8 +29,6 @@ module Layout
#
# def b
# end
#
# @api private
class EmptyLineBetweenDefs < Base
include RangeHelp
extend AutoCorrector
Expand Down
1 change: 0 additions & 1 deletion lib/rubocop/cop/layout/empty_lines.rb
Expand Up @@ -18,7 +18,6 @@ module Layout
# # one empty line
# some_method
#
# @api private
class EmptyLines < Base
include RangeHelp
extend AutoCorrector
Expand Down
Expand Up @@ -40,7 +40,6 @@ module Layout
# def baz; end
# end
#
# @api private
class EmptyLinesAroundAccessModifier < Base
include ConfigurableEnforcedStyle
include RangeHelp
Expand Down
1 change: 0 additions & 1 deletion lib/rubocop/cop/layout/empty_lines_around_arguments.rb
Expand Up @@ -38,7 +38,6 @@ module Layout
# x: y
# )
#
# @api private
class EmptyLinesAroundArguments < Base
include RangeHelp
extend AutoCorrector
Expand Down
Expand Up @@ -60,7 +60,6 @@ module Layout
# def do_something
# end
#
# @api private
class EmptyLinesAroundAttributeAccessor < Base
include RangeHelp
include AllowedMethods
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/empty_lines_around_begin_body.rb
Expand Up @@ -21,8 +21,6 @@ module Layout
# # ...
#
# end
#
# @api private
class EmptyLinesAroundBeginBody < Base
include EmptyLinesAroundBody
extend AutoCorrector
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/empty_lines_around_block_body.rb
Expand Up @@ -21,8 +21,6 @@ module Layout
# foo do |bar|
# # ...
# end
#
# @api private
class EmptyLinesAroundBlockBody < Base
include EmptyLinesAroundBody
extend AutoCorrector
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/empty_lines_around_class_body.rb
Expand Up @@ -64,8 +64,6 @@ module Layout
# # ...
# end
# end
#
# @api private
class EmptyLinesAroundClassBody < Base
include EmptyLinesAroundBody
extend AutoCorrector
Expand Down
Expand Up @@ -58,8 +58,6 @@ module Layout
#
# do_something2
# end
#
# @api private
class EmptyLinesAroundExceptionHandlingKeywords < Base
include EmptyLinesAroundBody
extend AutoCorrector
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/empty_lines_around_method_body.rb
Expand Up @@ -20,8 +20,6 @@ module Layout
# # ...
#
# end
#
# @api private
class EmptyLinesAroundMethodBody < Base
include EmptyLinesAroundBody
extend AutoCorrector
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/empty_lines_around_module_body.rb
Expand Up @@ -44,8 +44,6 @@ module Layout
# # ...
# end
# end
#
# @api private
class EmptyLinesAroundModuleBody < Base
include EmptyLinesAroundBody
extend AutoCorrector
Expand Down
2 changes: 0 additions & 2 deletions lib/rubocop/cop/layout/end_alignment.rb
Expand Up @@ -67,8 +67,6 @@ module Layout
# variable =
# if true
# end
#
# @api private
class EndAlignment < Base
include CheckAssignment
include EndKeywordAlignment
Expand Down

0 comments on commit 6d781b0

Please sign in to comment.