.rubocop.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. require:
  2. # https://docs.rubocop.org/rubocop-performance/
  3. - rubocop-performance
  4. AllCops:
  5. TargetRubyVersion: 3.1
  6. NewCops: enable
  7. Style/FrozenStringLiteralComment:
  8. EnforcedStyle: always_true
  9. Layout/EmptyLineAfterMagicComment:
  10. Enabled: false
  11. # Since I want to allow other Magic Comments after this.
  12. Style/GlobalVars:
  13. Enabled: false
  14. Style/RedundantReturn:
  15. Enabled: false
  16. Metrics/AbcSize:
  17. Max: 100
  18. Metrics/CyclomaticComplexity:
  19. Max: 20
  20. Metrics/PerceivedComplexity:
  21. Max: 20
  22. Metrics/MethodLength:
  23. Max: 60
  24. Metrics/ClassLength:
  25. Max: 400
  26. Metrics/BlockLength:
  27. Max: 100
  28. Metrics/BlockNesting:
  29. Max: 5
  30. Layout/LineLength:
  31. Max: 200
  32. Layout/ClassStructure:
  33. Enabled: true
  34. Layout/EndOfLine:
  35. EnforcedStyle: lf
  36. Layout/MultilineHashKeyLineBreaks:
  37. Enabled: true
  38. Security/CompoundHash:
  39. Enabled: true
  40. Security/IoMethods:
  41. Enabled: true
  42. # Enable cops, which are not enabled by default.
  43. ## These cops are "Pending" by default.
  44. Performance/CollectionLiteralInLoop:
  45. Enabled: true
  46. Performance/BigDecimalWithNumericArgument:
  47. Enabled: true
  48. Performance/BlockGivenWithExplicitBlock:
  49. Enabled: true
  50. Performance/ConstantRegexp:
  51. Enabled: true
  52. Performance/MethodObjectAsBlock:
  53. Enabled: true
  54. Performance/RedundantSortBlock:
  55. Enabled: true
  56. Performance/RedundantStringChars:
  57. Enabled: true
  58. Performance/ReverseFirst:
  59. Enabled: true
  60. Performance/SortReverse:
  61. Enabled: true
  62. Performance/Squeeze:
  63. Enabled: true
  64. Performance/StringIdentifierArgument:
  65. Enabled: true
  66. Performance/StringInclude:
  67. Enabled: true
  68. Performance/Sum:
  69. Enabled: true
  70. ## These cops are "Disabled" by default.
  71. Performance/CaseWhenSplat:
  72. Enabled: true
  73. Performance/ChainArrayAllocation:
  74. Enabled: true
  75. Performance/IoReadlines:
  76. Enabled: true
  77. Performance/OpenStruct:
  78. Enabled: true
  79. Performance/SelectMap:
  80. Enabled: true
  81. # Disable cops, which are enabled by default.
  82. ## These cops are "Enabled" by default.
  83. Performance/Casecmp:
  84. Enabled: false
  85. Performance/RangeInclude:
  86. Enabled: false