Mirror of metasploit
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

.rubocop.yml 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. # This list was intially created by analyzing the last three months (51
  2. # modules) committed to Metasploit Framework. Many, many older modules
  3. # will have offenses, but this should at least provide a baseline for
  4. # new modules.
  5. #
  6. # Updates to this file should include a 'Description' parameter for any
  7. # explaination needed.
  8. # inherit_from: .rubocop_todo.yml
  9. AllCops:
  10. TargetRubyVersion: 2.2
  11. Metrics/ClassLength:
  12. Description: 'Most Metasploit modules are quite large. This is ok.'
  13. Enabled: true
  14. Exclude:
  15. - 'modules/**/*'
  16. Metrics/AbcSize:
  17. Enabled: false
  18. Description: 'This is often a red-herring'
  19. Metrics/CyclomaticComplexity:
  20. Enabled: false
  21. Description: 'This is often a red-herring'
  22. Metrics/PerceivedComplexity:
  23. Enabled: false
  24. Description: 'This is often a red-herring'
  25. Style/FrozenStringLiteralComment:
  26. Enabled: false
  27. Description: 'We cannot support this yet without a lot of things breaking'
  28. Style/RedundantReturn:
  29. Description: 'This often looks weird when mixed with actual returns, and hurts nothing'
  30. Enabled: false
  31. Style/Documentation:
  32. Enabled: true
  33. Description: 'Most Metasploit modules do not have class documentation.'
  34. Exclude:
  35. - 'modules/**/*'
  36. Layout/IndentHeredoc:
  37. Enabled: false
  38. Description: 'We need to leave this disabled for Ruby 2.2 compat, remove in 2018'
  39. Style/GuardClause:
  40. Enabled: false
  41. Description: 'This often introduces bugs in tested code'
  42. Style/NegatedIf:
  43. Enabled: false
  44. Description: 'This often introduces bugs in tested code'
  45. Style/ConditionalAssignment:
  46. Enabled: false
  47. Description: 'This is confusing for folks coming from other languages'
  48. Style/Encoding:
  49. Enabled: true
  50. Description: 'We prefer binary to UTF-8.'
  51. EnforcedStyle: 'when_needed'
  52. Metrics/LineLength:
  53. Description: >-
  54. Metasploit modules often pattern match against very
  55. long strings when identifying targets.
  56. Enabled: true
  57. Max: 180
  58. Metrics/MethodLength:
  59. Enabled: true
  60. Description: >-
  61. While the style guide suggests 10 lines, exploit definitions
  62. often exceed 200 lines.
  63. Max: 300
  64. # Basically everything in metasploit needs binary encoding, not UTF-8.
  65. # Disable this here and enforce it through msftidy
  66. Style/Encoding:
  67. Enabled: false
  68. # %q() is super useful for long strings split over multiple lines and
  69. # is very common in module constructors for things like descriptions
  70. Style/UnneededPercentQ:
  71. Enabled: false
  72. Style/NumericLiterals:
  73. Enabled: false
  74. Description: 'This often hurts readability for exploit-ish code.'
  75. Layout/SpaceInsideBrackets:
  76. Enabled: false
  77. Description: 'Until module template are final, most modules will fail this.'
  78. Style/StringLiterals:
  79. Enabled: false
  80. Description: 'Single vs double quote fights are largely unproductive.'
  81. Style/WordArray:
  82. Enabled: false
  83. Description: 'Metasploit prefers consistent use of []'
  84. Style/RedundantBegin:
  85. Exclude:
  86. # this pattern is very common and somewhat unavoidable
  87. # def run_host(ip)
  88. # begin
  89. # ...
  90. # rescue ...
  91. # ...
  92. # ensure
  93. # disconnect
  94. # end
  95. # end
  96. - 'modules/**/*'
  97. Documentation:
  98. Exclude:
  99. - 'modules/**/*'