.rubocop.yml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. Metrics/ClassLength:
  10. Description: 'Most Metasploit modules are quite large. This is ok.'
  11. Enabled: true
  12. Exclude:
  13. - 'modules/**/*'
  14. Style/Documentation:
  15. Enabled: true
  16. Description: 'Most Metasploit modules do not have class documentation.'
  17. Exclude:
  18. - 'modules/**/*'
  19. Style/Encoding:
  20. Enabled: true
  21. Description: 'We prefer binary to UTF-8.'
  22. EnforcedStyle: 'when_needed'
  23. Metrics/LineLength:
  24. Description: >-
  25. Metasploit modules often pattern match against very
  26. long strings when identifying targets.
  27. Enabled: true
  28. Max: 180
  29. Metrics/MethodLength:
  30. Enabled: true
  31. Description: >-
  32. While the style guide suggests 10 lines, exploit definitions
  33. often exceed 200 lines.
  34. Max: 300
  35. # Basically everything in metasploit needs binary encoding, not UTF-8.
  36. # Disable this here and enforce it through msftidy
  37. Style/Encoding:
  38. Enabled: false
  39. # %q() is super useful for long strings split over multiple lines and
  40. # is very common in module constructors for things like descriptions
  41. Style/UnneededPercentQ:
  42. Enabled: false
  43. Style/NumericLiterals:
  44. Enabled: false
  45. Description: 'This often hurts readability for exploit-ish code.'
  46. Style/SpaceInsideBrackets:
  47. Enabled: false
  48. Description: 'Until module template are final, most modules will fail this.'
  49. Style/StringLiterals:
  50. Enabled: false
  51. Description: 'Single vs double quote fights are largely unproductive.'
  52. Style/WordArray:
  53. Enabled: false
  54. Description: 'Metasploit prefers consistent use of []'
  55. Style/RedundantBegin:
  56. Exclude:
  57. # this pattern is very common and somewhat unavoidable
  58. # def run_host(ip)
  59. # begin
  60. # ...
  61. # rescue ...
  62. # ...
  63. # ensure
  64. # disconnect
  65. # end
  66. # end
  67. - 'modules/**/*'
  68. Documentation:
  69. Exclude:
  70. - 'modules/**/*'