lib/rubocop/cop/style/class_vars.rb
# encoding: utf-8 module Rubocop module Cop module Style # This cop checks for uses of class variables. Offences # are signaled only on assignment to class variables to # reduced the number of offences that would be reported. class ClassVars < Cop MSG = 'Replace class var %s with a class instance var.' def on_cvasgn(node) convention(node, :name) end def message(node) class_var, = *node MSG.format(class_var) end end end end end
Source Files
- lib/rubocop.rb
- lib/rubocop/cli.rb
- lib/rubocop/config.rb
- lib/rubocop/config_loader.rb
- lib/rubocop/config_store.rb
- lib/rubocop/cop/commissioner.rb
- lib/rubocop/cop/cop.rb
- lib/rubocop/cop/corrector.rb
- lib/rubocop/cop/lint/assignment_in_condition.rb
- lib/rubocop/cop/lint/block_alignment.rb
- lib/rubocop/cop/lint/debugger.rb
- lib/rubocop/cop/lint/empty_ensure.rb
- lib/rubocop/cop/lint/end_alignment.rb
- lib/rubocop/cop/lint/end_in_method.rb
- lib/rubocop/cop/lint/ensure_return.rb
- lib/rubocop/cop/lint/eval.rb
- lib/rubocop/cop/lint/handle_exceptions.rb
- lib/rubocop/cop/lint/literal_in_condition.rb
- lib/rubocop/cop/lint/loop.rb
- lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb
- lib/rubocop/cop/lint/rescue_exception.rb
- lib/rubocop/cop/lint/shadowing_outer_local_variable.rb
- lib/rubocop/cop/lint/syntax.rb
- lib/rubocop/cop/lint/unreachable_code.rb
- lib/rubocop/cop/lint/useless_assignment.rb
- lib/rubocop/cop/lint/useless_comparison.rb
- lib/rubocop/cop/lint/useless_setter_call.rb
- lib/rubocop/cop/lint/void.rb
- lib/rubocop/cop/offence.rb
- lib/rubocop/cop/rails/has_and_belongs_to_many.rb
- lib/rubocop/cop/rails/read_attribute.rb
- lib/rubocop/cop/rails/validation.rb
- lib/rubocop/cop/style/access_control.rb
- lib/rubocop/cop/style/alias.rb
- lib/rubocop/cop/style/align_array.rb
- lib/rubocop/cop/style/align_hash.rb
- lib/rubocop/cop/style/align_parameters.rb
- lib/rubocop/cop/style/and_or.rb
- lib/rubocop/cop/style/ascii_comments.rb
- lib/rubocop/cop/style/ascii_identifiers.rb
- lib/rubocop/cop/style/attr.rb
- lib/rubocop/cop/style/autocorrect_alignment.rb
- lib/rubocop/cop/style/begin_block.rb
- lib/rubocop/cop/style/block_comments.rb
- lib/rubocop/cop/style/block_nesting.rb
- lib/rubocop/cop/style/blocks.rb
- lib/rubocop/cop/style/braces_around_hash_parameters.rb
- lib/rubocop/cop/style/case_equality.rb
- lib/rubocop/cop/style/case_indentation.rb
- lib/rubocop/cop/style/character_literal.rb
- lib/rubocop/cop/style/class_and_module_camel_case.rb
- lib/rubocop/cop/style/class_length.rb
- lib/rubocop/cop/style/class_methods.rb
- lib/rubocop/cop/style/class_vars.rb
- lib/rubocop/cop/style/collection_methods.rb
- lib/rubocop/cop/style/colon_method_call.rb
- lib/rubocop/cop/style/comment_annotation.rb
- lib/rubocop/cop/style/configurable_naming.rb
- lib/rubocop/cop/style/constant_name.rb
- lib/rubocop/cop/style/def_parentheses.rb
- lib/rubocop/cop/style/documentation.rb
- lib/rubocop/cop/style/dot_position.rb
- lib/rubocop/cop/style/empty_line_between_defs.rb
- lib/rubocop/cop/style/empty_lines.rb
- lib/rubocop/cop/style/empty_literal.rb
- lib/rubocop/cop/style/encoding.rb
- lib/rubocop/cop/style/end_block.rb
- lib/rubocop/cop/style/end_of_line.rb
- lib/rubocop/cop/style/even_odd.rb
- lib/rubocop/cop/style/favor_join.rb
- lib/rubocop/cop/style/favor_modifier.rb
- lib/rubocop/cop/style/favor_sprintf.rb
- lib/rubocop/cop/style/favor_unless_over_negated_if.rb
- lib/rubocop/cop/style/final_newline.rb
- lib/rubocop/cop/style/for.rb
- lib/rubocop/cop/style/global_vars.rb
- lib/rubocop/cop/style/hash_methods.rb
- lib/rubocop/cop/style/hash_syntax.rb
- lib/rubocop/cop/style/if_then_else.rb
- lib/rubocop/cop/style/if_with_semicolon.rb
- lib/rubocop/cop/style/indentation_width.rb
- lib/rubocop/cop/style/lambda.rb
- lib/rubocop/cop/style/lambda_call.rb
- lib/rubocop/cop/style/leading_comment_space.rb
- lib/rubocop/cop/style/line_length.rb
- lib/rubocop/cop/style/method_call_parentheses.rb
- lib/rubocop/cop/style/method_called_on_do_end_block.rb
- lib/rubocop/cop/style/method_length.rb
- lib/rubocop/cop/style/method_name.rb
- lib/rubocop/cop/style/module_function.rb
- lib/rubocop/cop/style/multiline_block_chain.rb
- lib/rubocop/cop/style/multiline_if_then.rb
- lib/rubocop/cop/style/nil_comparison.rb
- lib/rubocop/cop/style/not.rb
- lib/rubocop/cop/style/numeric_literals.rb
- lib/rubocop/cop/style/one_line_conditional.rb
- lib/rubocop/cop/style/op_method.rb
- lib/rubocop/cop/style/parameter_lists.rb
- lib/rubocop/cop/style/parentheses_around_condition.rb
- lib/rubocop/cop/style/perl_backrefs.rb
- lib/rubocop/cop/style/proc.rb
- lib/rubocop/cop/style/raise_args.rb
- lib/rubocop/cop/style/reduce_arguments.rb
- lib/rubocop/cop/style/redundant_begin.rb
- lib/rubocop/cop/style/redundant_exception.rb
- lib/rubocop/cop/style/redundant_return.rb
- lib/rubocop/cop/style/redundant_self.rb
- lib/rubocop/cop/style/regexp_literal.rb
- lib/rubocop/cop/style/rescue_modifier.rb
- lib/rubocop/cop/style/semicolon.rb
- lib/rubocop/cop/style/signal_exception.rb
- lib/rubocop/cop/style/single_line_methods.rb
- lib/rubocop/cop/style/space_after_comma_etc.rb
- lib/rubocop/cop/style/space_after_control_keyword.rb
- lib/rubocop/cop/style/space_after_method_name.rb
- lib/rubocop/cop/style/space_after_not.rb
- lib/rubocop/cop/style/space_before_modifier_keyword.rb
- lib/rubocop/cop/style/special_global_vars.rb
- lib/rubocop/cop/style/string_help.rb
- lib/rubocop/cop/style/string_literals.rb
- lib/rubocop/cop/style/surrounding_space.rb
- lib/rubocop/cop/style/symbol_array.rb
- lib/rubocop/cop/style/symbol_name.rb
- lib/rubocop/cop/style/tab.rb
- lib/rubocop/cop/style/ternary_operator.rb
- lib/rubocop/cop/style/trailing_blank_lines.rb
- lib/rubocop/cop/style/trailing_whitespace.rb
- lib/rubocop/cop/style/trivial_accessors.rb
- lib/rubocop/cop/style/unless_else.rb
- lib/rubocop/cop/style/variable_interpolation.rb
- lib/rubocop/cop/style/variable_name.rb
- lib/rubocop/cop/style/when_then.rb
- lib/rubocop/cop/style/while_until_do.rb
- lib/rubocop/cop/style/word_array.rb
- lib/rubocop/cop/team.rb
- lib/rubocop/cop/util.rb
- lib/rubocop/cop/variable_inspector.rb
- lib/rubocop/cop/variable_inspector/assignment.rb
- lib/rubocop/cop/variable_inspector/locatable.rb
- lib/rubocop/cop/variable_inspector/reference.rb
- lib/rubocop/cop/variable_inspector/scope.rb
- lib/rubocop/cop/variable_inspector/variable.rb
- lib/rubocop/cop/variable_inspector/variable_table.rb
- lib/rubocop/formatter/base_formatter.rb
- lib/rubocop/formatter/clang_style_formatter.rb
- lib/rubocop/formatter/disabled_config_formatter.rb
- lib/rubocop/formatter/emacs_style_formatter.rb
- lib/rubocop/formatter/file_list_formatter.rb
- lib/rubocop/formatter/formatter_set.rb
- lib/rubocop/formatter/json_formatter.rb
- lib/rubocop/formatter/offence_count_formatter.rb
- lib/rubocop/formatter/progress_formatter.rb
- lib/rubocop/formatter/simple_text_formatter.rb
- lib/rubocop/options.rb
- lib/rubocop/processed_source.rb
- lib/rubocop/rake_task.rb
- lib/rubocop/source_parser.rb
- lib/rubocop/target_finder.rb
- lib/rubocop/token.rb
- lib/rubocop/version.rb