docs: def get_config(repo_root):
      """Gets the configuration file either from the repository or the default."""
      config = os.path.join(os.path.dirname(__file__), 'configs', 'config.yaml')
  
      if repo_root:
          repo_config = os.path.join(repo_root, '.gitlint.yaml')
          if os.path.exists(repo_config):
              config = repo_config
  
      with open(config) as f:
          # We have to read the content first as yaml hangs up when reading from
          # MockOpen
          content = f.read()
          # Yaml.load will return None when the input is empty.
          if not content:
              yaml_config = {}
          else:
              yaml_config = yaml.load(content)
  
      return linters.parse_yaml_config(yaml_config, repo_root)