rubocop-yayoi 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -0
  3. data/Rakefile +2 -0
  4. data/bin/console +1 -0
  5. data/lib/rubocop-yayoi.rb +2 -0
  6. data/lib/rubocop/cop/layout/def_end_alignment.rb +1 -1
  7. data/lib/rubocop/cop/layout/empty_line_between_defs.rb +1 -1
  8. data/lib/rubocop/cop/layout/empty_lines.rb +1 -1
  9. data/lib/rubocop/cop/layout/empty_lines_around_method_body.rb +1 -1
  10. data/lib/rubocop/cop/layout/indentation_consistency.rb +1 -1
  11. data/lib/rubocop/cop/layout/indentation_width.rb +1 -1
  12. data/lib/rubocop/cop/layout/initial_indentation.rb +1 -1
  13. data/lib/rubocop/cop/layout/space_around_operators.rb +2 -2
  14. data/lib/rubocop/cop/lint/ambiguous_block_association.rb +1 -1
  15. data/lib/rubocop/cop/lint/ineffective_access_modifier.rb +3 -3
  16. data/lib/rubocop/cop/lint/unreachable_code.rb +1 -1
  17. data/lib/rubocop/cop/lint/useless_access_modifier.rb +1 -1
  18. data/lib/rubocop/cop/lint/useless_assignment.rb +1 -1
  19. data/lib/rubocop/cop/metrics/cyclomatic_complexity.rb +1 -1
  20. data/lib/rubocop/cop/metrics/line_length.rb +1 -1
  21. data/lib/rubocop/cop/metrics/perceived_complexity.rb +1 -1
  22. data/lib/rubocop/cop/mixin/empty_lines_around_body.rb +3 -3
  23. data/lib/rubocop/cop/mixin/end_keyword_alignment.rb +1 -1
  24. data/lib/rubocop/cop/mixin/space_after_punctuation.rb +1 -1
  25. data/lib/rubocop/cop/mixin/uncommunicative_name.rb +1 -1
  26. data/lib/rubocop/cop/naming/ascii_identifiers.rb +1 -1
  27. data/lib/rubocop/cop/naming/class_and_module_camel_case.rb +1 -1
  28. data/lib/rubocop/cop/naming/variable_name.rb +1 -1
  29. data/lib/rubocop/cop/style/and_or.rb +1 -1
  30. data/lib/rubocop/cop/style/ascii_comments.rb +1 -1
  31. data/lib/rubocop/cop/style/colon_method_call.rb +1 -1
  32. data/lib/rubocop/cop/style/comment_annotation.rb +2 -2
  33. data/lib/rubocop/cop/style/def_with_parentheses.rb +1 -1
  34. data/lib/rubocop/cop/style/documentation.rb +1 -1
  35. data/lib/rubocop/cop/style/double_negation.rb +1 -1
  36. data/lib/rubocop/cop/style/empty_method.rb +2 -2
  37. data/lib/rubocop/cop/style/mutable_constant.rb +1 -1
  38. data/lib/rubocop/cop/style/numeric_literals.rb +1 -1
  39. data/lib/rubocop/cop/style/redundant_return.rb +2 -2
  40. data/lib/rubocop/cop/style/symbol_array.rb +2 -2
  41. data/lib/rubocop/cop/style/unneeded_condition.rb +2 -2
  42. data/lib/rubocop/cop/style/unneeded_interpolation.rb +1 -1
  43. data/lib/rubocop/cop/style/word_array.rb +2 -2
  44. data/lib/rubocop/formatter/simple_text_formatter.rb +1 -1
  45. data/lib/rubocop/yayoi.rb +2 -0
  46. data/lib/rubocop/yayoi/version.rb +3 -1
  47. data/rubocop-yayoi.gemspec +2 -0
  48. data/spec/rubocop/yayoi_spec.rb +2 -0
  49. data/spec/spec_helper.rb +2 -0
  50. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8b1eb1be46ec7f4b73fbe7bceae1a6eb190f77e8603f7df5ba08018bdc14baf
4
- data.tar.gz: a2dbade19948eacf246522e3dd3f1d8c3883e22097a674d527208529e041029d
3
+ metadata.gz: 124b64a2d3ece79d7e8fbfd0074a8f4316e5707ca5cb0923e1b99e7da34f1e0d
4
+ data.tar.gz: 063be9159e07396954cef5477e5bbeaf1340e74a4b312311704175ab18252c47
5
5
  SHA512:
6
- metadata.gz: 9c34b3346bb085e5a2c81779ec51dd815a0df5518534a981ce77ed012cca4dcc06feb9e21126ff241df1a50c8e0b6fc2766fddaf73af3fd60c712ef54a90bb94
7
- data.tar.gz: 77486cb28980de30d35c1f05113710a4e9849f54dd4814c259fdba8474360a1812609271bfe6539f331e73a3431b3da461b87f35cb91473908a4b36e07a9ba9b
6
+ metadata.gz: 94712aadf89ff21ab8960e2e127317f31ecfcc3593950ea5c765b8c9f1e16ad90eb9e09c32ca010d8d050133e0922ec6d94ad27fccac623bac4041a527e027a7
7
+ data.tar.gz: 9f7edadad232e7f012050c35e0d1ee5550c0d241c75b065ced2d5c42de07ac9b266ced5c929a8a0b1a54b7817e3ea788a98b92320dfe3e2f1ad27a5061396600
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in rubocop-yayoi.gemspec
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/gem_tasks'
2
4
  require 'rspec/core/rake_task'
3
5
 
data/bin/console CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'bundler/setup'
4
5
  require 'rubocop/yayoi'
data/lib/rubocop-yayoi.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubocop'
2
4
 
3
5
  require_relative 'rubocop/cop/cop'
@@ -5,7 +5,7 @@ module RuboCop
5
5
  module Layout
6
6
  class DefEndAlignment < Cop
7
7
  include EndKeywordAlignment
8
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!%d, %dにある`end`が%d, %dにある`%s`とずれていますよー!".freeze
8
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!%d, %dにある`end`が%d, %dにある`%s`とずれていますよー!"
9
9
  end
10
10
  end
11
11
  end
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Layout
6
6
  class EmptyLineBetweenDefs < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!メソッドとメソッドの間には空行をいれましょうねー!".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!メソッドとメソッドの間には空行をいれましょうねー!"
8
8
  end
9
9
  end
10
10
  end
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Layout
6
6
  class EmptyLines < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!余分な改行がありますよー!".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!余分な改行がありますよー!"
8
8
  end
9
9
  end
10
10
  end
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Layout
6
6
  class EmptyLinesAroundMethodBody < Cop
7
- YAYOI_KIND = 'メソッド'.freeze
7
+ YAYOI_KIND = 'メソッド'
8
8
  end
9
9
  end
10
10
  end
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Layout
6
6
  class IndentationConsistency < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!矛盾しているインデントの場所がありますよー!".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!矛盾しているインデントの場所がありますよー!"
8
8
  end
9
9
  end
10
10
  end
@@ -6,7 +6,7 @@ module RuboCop
6
6
  class IndentationWidth < Cop
7
7
  YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!" \
8
8
  '%<configured_indentation_width>dスペースを使いましょうねー' \
9
- '(%<indentation>dはだめですよー)'.freeze
9
+ '(%<indentation>dはだめですよー)'
10
10
  end
11
11
  end
12
12
  end
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Layout
6
6
  class InitialIndentation < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!ファイルの最初の行はインデントをいれないでくださいねー!".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!ファイルの最初の行はインデントをいれないでくださいねー!"
8
8
  end
9
9
  end
10
10
  end
@@ -4,12 +4,12 @@ module RuboCop
4
4
  module Cop
5
5
  module Layout
6
6
  class SpaceAroundOperators < Cop
7
- def offense_message(operator, with_space, right_operand)
7
+ def offense_message(type, operator, with_space, right_operand)
8
8
  if operator.is?('**')
9
9
  "ζ*'ヮ')ζ<うっうー!`**`のまわりにスペースがありますよー!" unless with_space.is?('**')
10
10
  elsif with_space.source !~ /^\s.*\s$/
11
11
  "ζ*'ヮ')ζ<うっうー!`#{operator.source}`のまわりにスペースがありませんよー!"
12
- elsif excess_leading_space?(operator, with_space) ||
12
+ elsif excess_leading_space?(type, operator, with_space) ||
13
13
  excess_trailing_space?(right_operand, with_space)
14
14
  "ζ*'ヮ')ζ<うっうー!`#{operator.source}`のまわりはスペース1こあけましょうねー!"
15
15
  end
@@ -6,7 +6,7 @@ module RuboCop
6
6
  class AmbiguousBlockAssociation < Cop
7
7
  YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!" \
8
8
  'ブロックが`%<method>s`メソッドの呼び出しにちゃんと関連連れられているかわからないですー。' \
9
- 'ちゃんと`%<param>s`にカッコを使いましょうねー!'.freeze
9
+ 'ちゃんと`%<param>s`にカッコを使いましょうねー!'
10
10
 
11
11
  def message(send_node)
12
12
  block_param = send_node.last_argument
@@ -6,11 +6,11 @@ module RuboCop
6
6
  class IneffectiveAccessModifier < Cop
7
7
  YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!%<line>d行目にある`%<modifier>s`は" \
8
8
  'シングルトンメソッドの%<modifier>sを作りませんよー!' \
9
- '代わりに%<alternative>s'.freeze
9
+ '代わりに%<alternative>s'
10
10
  YAYOI_ALTERNATIVE_PRIVATE = '`private_class_method`か`private`を' \
11
- '`class << self`ブロックの内部に置きましょー!'.freeze
11
+ '`class << self`ブロックの内部に置きましょー!'
12
12
  YAYOI_ALTERNATIVE_PROTECTED = '`protected`を' \
13
- '`class << self`ブロックの内部に置きましょー!'.freeze
13
+ '`class << self`ブロックの内部に置きましょー!'
14
14
 
15
15
  def format_message(modifier)
16
16
  visibility = modifier.method_name
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Lint
6
6
  class UnreachableCode < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!処理されないコードがありますよー!".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!処理されないコードがありますよー!"
8
8
  end
9
9
  end
10
10
  end
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Lint
6
6
  class UselessAccessModifier < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!`%<current>s`は意味がないですよー!".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!`%<current>s`は意味がないですよー!"
8
8
 
9
9
  def check_node(node)
10
10
  return if node.nil?
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Lint
6
6
  class UselessAssignment < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!使っていない変数がありますよー! - `%<variable>s`.".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!使っていない変数がありますよー! - `%<variable>s`."
8
8
 
9
9
  def message_for_useless_assignment(assignment)
10
10
  variable = assignment.variable
@@ -5,7 +5,7 @@ module RuboCop
5
5
  module Metrics
6
6
  class CyclomaticComplexity < Cop
7
7
  YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!%<method>sの循環的複雑度がとても高いですよー!" \
8
- '[%<complexity>d/%<max>d]'.freeze
8
+ '[%<complexity>d/%<max>d]'
9
9
  end
10
10
  end
11
11
  end
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Metrics
6
6
  class LineLength < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!一行の長さがとても長いですよー! [%<length>d/%<max>d]".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!一行の長さがとても長いですよー! [%<length>d/%<max>d]"
8
8
  end
9
9
  end
10
10
  end
@@ -5,7 +5,7 @@ module RuboCop
5
5
  module Metrics
6
6
  class PerceivedComplexity < Cop
7
7
  YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!%<method>sの複雑度がとても高いですよー!" \
8
- '[%<complexity>d/%<max>d]'.freeze
8
+ '[%<complexity>d/%<max>d]'
9
9
  end
10
10
  end
11
11
  end
@@ -4,9 +4,9 @@ module RuboCop
4
4
  module Cop
5
5
  module Layout
6
6
  module EmptyLinesAroundBody
7
- YAYOI_MSG_EXTRA = "ζ*'ヮ')ζ<うっうー!%<kind>sに空行が見つかりましたよー!".freeze
8
- YAYOI_MSG_MISSING = "ζ*'ヮ')ζ<うっうー!%<kind>sのまわりに空行がないですよー!".freeze
9
- YAYOI_MSG_DEFERRED = "ζ*'ヮ')ζ<うっうー!%<type>sの前に空行がないですよー!".freeze
7
+ YAYOI_MSG_EXTRA = "ζ*'ヮ')ζ<うっうー!%<kind>sに空行が見つかりましたよー!"
8
+ YAYOI_MSG_MISSING = "ζ*'ヮ')ζ<うっうー!%<kind>sのまわりに空行がないですよー!"
9
+ YAYOI_MSG_DEFERRED = "ζ*'ヮ')ζ<うっうー!%<type>sの前に空行がないですよー!"
10
10
 
11
11
  def check_source(style, line_no, desc)
12
12
  case style
@@ -5,7 +5,7 @@ module RuboCop
5
5
  module EndKeywordAlignment
6
6
  YAYOI_MSG = "ζ*'ヮ')ζ<うっうー! %<end_line>d, %<end_col>dにある`end`が" \
7
7
  '%<align_line>d, %<align_col>d' \
8
- 'にある`%<source>s`とずれていますよー!'.freeze
8
+ 'にある`%<source>s`とずれていますよー!'
9
9
 
10
10
  def add_offense_for_misalignment(node, align_with)
11
11
  end_loc = node.loc.end
@@ -3,7 +3,7 @@
3
3
  module RuboCop
4
4
  module Cop
5
5
  module SpaceAfterPunctuation
6
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!%<token>sの後ろにスペースがないですよー!".freeze
6
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!%<token>sの後ろにスペースがないですよー!"
7
7
 
8
8
  def investigate(processed_source)
9
9
  each_missing_space(processed_source.tokens) do |token|
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module UncommunicativeName
6
6
  YAYOI_LENGTH_YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!" \
7
- '%<name_type>sの長さは最低でも%<min>s文字以上にしましょうねー!'.freeze
7
+ '%<name_type>sの長さは最低でも%<min>s文字以上にしましょうねー!'
8
8
 
9
9
  def name_type(node)
10
10
  @name_type ||= begin
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Naming
6
6
  class AsciiIdentifiers < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!識別子にはラテン文字だけを使いましょうねー".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!識別子にはラテン文字だけを使いましょうねー"
8
8
  end
9
9
  end
10
10
  end
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Naming
6
6
  class ClassAndModuleCamelCase < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!モデル名やモジュール名にはCamelCaseを使いましょうねー!".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!モデル名やモジュール名にはCamelCaseを使いましょうねー!"
8
8
  end
9
9
  end
10
10
  end
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Naming
6
6
  class VariableName < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!変数名は%<style>sを使いましょうねー".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!変数名は%<style>sを使いましょうねー"
8
8
  end
9
9
  end
10
10
  end
@@ -5,7 +5,7 @@ module RuboCop
5
5
  module Style
6
6
  class AndOr < Cop
7
7
  YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!" \
8
- '`%<current>s` じゃなくて `%<prefer>s` をつかいましょうねー!'.freeze
8
+ '`%<current>s` じゃなくて `%<prefer>s` をつかいましょうねー!'
9
9
  end
10
10
  end
11
11
  end
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Style
6
6
  class AsciiComments < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!コメントにはラテン文字だけを使いましょうねー".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!コメントにはラテン文字だけを使いましょうねー"
8
8
  end
9
9
  end
10
10
  end
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Style
6
6
  class ColonMethodCall < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!メソッドを呼ぶのに`::`を使ってはいけません!".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!メソッドを呼ぶのに`::`を使ってはいけません!"
8
8
  end
9
9
  end
10
10
  end
@@ -5,9 +5,9 @@ module RuboCop
5
5
  module Style
6
6
  class CommentAnnotation < Cop
7
7
  YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!`%<keyword>s`のような注釈は全部大きい文字にして" \
8
- 'コロン、スペースのあとにコメントを書きましょうねー!'.freeze
8
+ 'コロン、スペースのあとにコメントを書きましょうねー!'
9
9
  YAYOI_MISSING_NOTE = "ζ*'ヮ')ζ<うっうー!" \
10
- '`%<keyword>s`があるけども、肝心のコメントがないですよー!'.freeze
10
+ '`%<keyword>s`があるけども、肝心のコメントがないですよー!'
11
11
 
12
12
  def investigate(processed_source)
13
13
  processed_source.comments.each_with_index do |comment, index|
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Style
6
6
  class DefWithParentheses < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!メソッドに引数がないときは、`()`を省略しましょうねー!".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!メソッドに引数がないときは、`()`を省略しましょうねー!"
8
8
  end
9
9
  end
10
10
  end
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Style
6
6
  class Documentation < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!%<type>sのドキュメントのコメントを書きましょうねー".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!%<type>sのドキュメントのコメントを書きましょうねー"
8
8
 
9
9
  def check(node, body, type)
10
10
  return if namespace?(body)
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Style
6
6
  class DoubleNegation < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!二重否定を使わないようにしましょうねー! (`!!`)".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!二重否定を使わないようにしましょうねー! (`!!`)"
8
8
  end
9
9
  end
10
10
  end
@@ -4,9 +4,9 @@ module RuboCop
4
4
  module Cop
5
5
  module Style
6
6
  class EmptyMethod < Cop
7
- YAYOI_MSG_COMPACT = "ζ*'ヮ')ζ<うっうー!なにも書いてないメソッドは1行で書きましょうねー!".freeze
7
+ YAYOI_MSG_COMPACT = "ζ*'ヮ')ζ<うっうー!なにも書いてないメソッドは1行で書きましょうねー!"
8
8
  YAYOI_MSG_EXPANDED = "ζ*'ヮ')ζ<うっうー!なにも書いてないメソッドは1行で書かないで、" \
9
- '`end`を次の行に書きましょうねー!'.freeze
9
+ '`end`を次の行に書きましょうねー!'
10
10
 
11
11
  def message(_node)
12
12
  compact_style? ? YAYOI_MSG_COMPACT : YAYOI_MSG_EXPANDED
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Style
6
6
  class MutableConstant < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!書き換え可能な定数を`.freeze`で更新できないようにしましょうねー!".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!書き換え可能な定数を`.freeze`で更新できないようにしましょうねー!"
8
8
  end
9
9
  end
10
10
  end
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Style
6
6
  class NumericLiterals < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!3桁区切りにアンダースコア(_)を使いましょうねー!".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!3桁区切りにアンダースコア(_)を使いましょうねー!"
8
8
  end
9
9
  end
10
10
  end
@@ -4,9 +4,9 @@ module RuboCop
4
4
  module Cop
5
5
  module Style
6
6
  class RedundantReturn < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!冗長な`return`がありますよー!".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!冗長な`return`がありますよー!"
8
8
  YAYOI_MULTI_RETURN_YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!" \
9
- '複数の値を返すときは配列を使いましょうねー!'.freeze
9
+ '複数の値を返すときは配列を使いましょうねー!'
10
10
 
11
11
  def message(node)
12
12
  if !allow_multiple_return_values? && node.children.size > 1
@@ -5,8 +5,8 @@ module RuboCop
5
5
  module Style
6
6
  class SymbolArray < Cop
7
7
  PERCENT_YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!" \
8
- 'シンボルだけだけの配列には`%w`か`%W`を使いましょうねー!'.freeze
9
- ARRAY_YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!配列には`[]`を使いましょうねー!".freeze
8
+ 'シンボルだけだけの配列には`%w`か`%W`を使いましょうねー!'
9
+ ARRAY_YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!配列には`[]`を使いましょうねー!"
10
10
 
11
11
  def message(_node)
12
12
  if style == :percent
@@ -4,8 +4,8 @@ module RuboCop
4
4
  module Cop
5
5
  module Style
6
6
  class UnneededCondition < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!ダブルパイプ(`||`)を使いましょうねー!".freeze
8
- YAYOI_UNNEEDED_CONDITION = "ζ*'ヮ')ζ<うっうー!いらない条件がありますよー!".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!ダブルパイプ(`||`)を使いましょうねー!"
8
+ YAYOI_UNNEEDED_CONDITION = "ζ*'ヮ')ζ<うっうー!いらない条件がありますよー!"
9
9
 
10
10
  def message(node)
11
11
  if node.modifier_form? || !node.else_branch
@@ -4,7 +4,7 @@ module RuboCop
4
4
  module Cop
5
5
  module Style
6
6
  class UnneededInterpolation < Cop
7
- YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!文字列の式展開よりも`to_s`を使いましょうねー!".freeze
7
+ YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!文字列の式展開よりも`to_s`を使いましょうねー!"
8
8
  end
9
9
  end
10
10
  end
@@ -5,8 +5,8 @@ module RuboCop
5
5
  module Style
6
6
  class WordArray < Cop
7
7
  PERCENT_YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!" \
8
- '文字列だけだけの配列には`%w`か`%W`を使いましょうねー!'.freeze
9
- ARRAY_YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!配列には`[]`を使いましょうねー!".freeze
8
+ '文字列だけだけの配列には`%w`か`%W`を使いましょうねー!'
9
+ ARRAY_YAYOI_MSG = "ζ*'ヮ')ζ<うっうー!配列には`[]`を使いましょうねー!"
10
10
 
11
11
  def message(_node)
12
12
  if style == :percent
@@ -5,7 +5,7 @@ module RuboCop
5
5
  class SimpleTextFormatter < BaseFormatter
6
6
  class Report
7
7
  def summary
8
- if @correction_count > 0
8
+ if @correction_count.positive?
9
9
  "ζ*'ヮ')ζ<うっうー!#{@file_count}ファイルチェックしましたよー!\r\n" \
10
10
  "#{offences_text}\r\n" \
11
11
  "ζ*'ヮ')ζ<うっうー#{corrections}直しましたよー!"
data/lib/rubocop/yayoi.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubocop/yayoi/version'
2
4
 
3
5
  module Rubocop
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Rubocop
2
4
  module Yayoi
3
- VERSION = '0.1.0'.freeze
5
+ VERSION = '0.1.1'
4
6
  end
5
7
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  lib = File.expand_path('lib', __dir__)
2
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'rubocop/yayoi/version'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  RSpec.describe Rubocop::Yayoi do
2
4
  it 'has a version number' do
3
5
  expect(Rubocop::Yayoi::VERSION).not_to be nil
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'bundler/setup'
2
4
  require 'rubocop/yayoi'
3
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-yayoi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - YutaGoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-21 00:00:00.000000000 Z
11
+ date: 2019-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop