Skip to content

Commit

Permalink
Mark Cops and Formatters as private
Browse files Browse the repository at this point in the history
  • Loading branch information
marcandre authored and mergify[bot] committed Aug 27, 2020
1 parent 36742ea commit 90d5333
Show file tree
Hide file tree
Showing 448 changed files with 767 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/rubocop/cop/bundler/duplicated_gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ module Bundler
#
# # good
# gem 'rubocop', groups: [:development, :test]
#
# @api private
class DuplicatedGem < Cop
include RangeHelp

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

Expand Down
2 changes: 2 additions & 0 deletions lib/rubocop/cop/bundler/insecure_protocol_source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ 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: 2 additions & 0 deletions lib/rubocop/cop/bundler/ordered_gems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ module Bundler
# gem 'rubocop'
# # For tests
# gem 'rspec'
#
# @api private
class OrderedGems < Cop
include ConfigurableEnforcedStyle
include OrderedGemNode
Expand Down
2 changes: 2 additions & 0 deletions lib/rubocop/cop/cop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ 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: 2 additions & 0 deletions lib/rubocop/cop/gemspec/duplicated_assignment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ 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: 2 additions & 0 deletions lib/rubocop/cop/gemspec/ordered_dependencies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ 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: 2 additions & 0 deletions lib/rubocop/cop/gemspec/required_ruby_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ 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: 1 addition & 0 deletions lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ 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: 1 addition & 0 deletions lib/rubocop/cop/internal_affairs/method_name_equal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module InternalAffairs
# # good
# node.method?(:do_something)
#
# @api private
class MethodNameEqual < Base
include RangeHelp
extend AutoCorrector
Expand Down
2 changes: 2 additions & 0 deletions lib/rubocop/cop/internal_affairs/node_destructuring.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ 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: 1 addition & 0 deletions lib/rubocop/cop/internal_affairs/node_type_predicate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ module InternalAffairs
# # good
# node.send_type?
#
# @api private
class NodeTypePredicate < Base
extend AutoCorrector

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ module InternalAffairs
# add_offense(node)
# add_offense(node, location: :selector)
#
# @api private
class RedundantLocationArgument < Base
include RangeHelp
extend AutoCorrector
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ 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
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ 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: 2 additions & 0 deletions lib/rubocop/cop/layout/access_modifier_indentation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ module Layout
# private
# def smooth; end
# end
#
# @api private
class AccessModifierIndentation < Cop
include Alignment
include ConfigurableEnforcedStyle
Expand Down
2 changes: 2 additions & 0 deletions lib/rubocop/cop/layout/argument_alignment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ module Layout
#
# foo :bar,
# :baz
#
# @api private
class ArgumentAlignment < Cop
include Alignment

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

Expand Down
2 changes: 2 additions & 0 deletions lib/rubocop/cop/layout/assignment_indentation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ 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: 2 additions & 0 deletions lib/rubocop/cop/layout/block_alignment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ module Layout
# .each do
# baz
# end
#
# @api private
class BlockAlignment < Base
include ConfigurableEnforcedStyle
include RangeHelp
Expand Down
2 changes: 2 additions & 0 deletions lib/rubocop/cop/layout/block_end_newline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ module Layout
# blah { |i|
# foo(i)
# }
#
# @api private
class BlockEndNewline < Cop
include Alignment

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

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

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

0 comments on commit 90d5333

Please sign in to comment.