You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: w3c_validator.rb
    path of file: ./repos/nanoc/nanoc-checking/lib/nanoc/checking/checks
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Nanoc
  module Checking
    module Checks
      # @api private
      class W3CValidator < ::Nanoc::Checking::Check
        def run
          require 'w3c_validators'
          require 'resolv-replace'

          Dir[@config.output_dir + '/**/*.' + extension].each do |filenam
    
        def run
          require 'w3c_validators'
          require 'resolv-replace'

          Dir[@config.output_dir + '/**/*.' + extension].each do |filename|
            results = validator_class.new.validate_file(filename)
            lines = File.readlines(filename)
            results.errors.each do |e|
              line_num = e.line.to_i - 1
              line = lines[line_num]
              message = e.message.gsub(%r{\s+}, ' ').strip.sub(/\s+:$/, '')
              desc = "line #{line_num + 1}: #{message}: #{line}"
              add_issue(desc, subject: filename)
            end
          end
        end