def count_errors(should_fail=false)
      ensure_flake8_is_installed

      total_errors = run_flake(:count => true).first.to_i
      if total_errors > threshold
        message = "#{total_errors} PEP 8 issues found"
        should_fail ? fail(message) : warn(message)
      end
    end
def count_errors(should_fail=false)
      ensure_flake8_is_installed

      total_errors = run_flake(:count => true).first.to_i
      if total_errors > threshold
        message = "#{total_errors} PEP 8 issues found"
        should_fail ? fail(message) : warn(message)
      end
    end
Triggers a warning/failure if total lint errors found exceedes @threshold
 @param [Bool] should_fail
        A flag to indicate whether it should warn ou fail the build.
        It adds an entry on the corresponding warnings/failures table.
 @return [void]