diff --git a/.rubocop.yml b/.rubocop.yml index 069012c..aff55a6 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -6,30 +6,26 @@ AllCops: NewCops: enable TargetRubyVersion: 3.3 -Metrics/MethodLength: - Max: 30 - -Metrics/ClassLength: - Max: 200 +Gemspec/DevelopmentDependencies: + EnforcedStyle: gemspec -Metrics/ModuleLength: - Max: 200 +# Metrics limits are ratcheted to the current worst case so complexity can't grow. +# Lower them as methods are simplified. +Metrics/AbcSize: + Max: 33 Metrics/BlockLength: - Max: 50 + Exclude: + - spec/**/* -Gemspec/DevelopmentDependencies: - EnforcedStyle: gemspec +Metrics/ClassLength: + Max: 165 -# TODO: Enable these cops after fixing the issues Metrics/CyclomaticComplexity: - Enabled: false - -Metrics/PerceivedComplexity: - Enabled: false + Max: 15 -Metrics/AbcSize: - Enabled: false +Metrics/MethodLength: + Max: 28 -Style/Documentation: - Enabled: false +Metrics/PerceivedComplexity: + Max: 17 diff --git a/lib/html2text.rb b/lib/html2text.rb index 448c2a9..a1664df 100644 --- a/lib/html2text.rb +++ b/lib/html2text.rb @@ -2,6 +2,7 @@ require 'nokogiri' +# Converts HTML into plain text, approximating how a browser would render it. class Html2Text attr_reader :doc