code: def process_paths(options, candidates=None, error=True):
      
      errors = check_path(options, rootdir=CURDIR, candidates=candidates)
  
      if options.format in ['pycodestyle', 'pep8']:
          pattern = "%(filename)s:%(lnum)s:%(col)s: %(text)s"
      elif options.format == 'pylint':
          pattern = "%(filename)s:%(lnum)s: [%(type)s] %(text)s"
      else:  # 'parsable'
          pattern = "%(filename)s:%(lnum)s:%(col)s: [%(type)s] %(text)s"
  
      for er in errors:
          if options.abspath:
              er._info['filename'] = op.abspath(er.filename)
          LOGGER.warning(pattern, er._info)
  
      if error:
          sys.exit(int(bool(errors)))
  
      return errors
docs: Process files and log errors.