Class: Dependabot::Config::FileFetcher

Inherits:
FileFetchers::Base show all
Extended by:
T::Sig
Defined in:
lib/dependabot/config/file_fetcher.rb

Constant Summary collapse

CONFIG_FILE_PATHS =
T.let(%w(.github/dependabot.yml .github/dependabot.yaml).freeze, T::Array[String])

Constants inherited from FileFetchers::Base

FileFetchers::Base::CLIENT_NOT_FOUND_ERRORS, FileFetchers::Base::GIT_RETRYABLE_ERRORS, FileFetchers::Base::GIT_SUBMODULE_CLONE_ERROR, FileFetchers::Base::GIT_SUBMODULE_ERROR_REGEX, FileFetchers::Base::GIT_SUBMODULE_INACCESSIBLE_ERROR

Instance Attribute Summary

Attributes inherited from FileFetchers::Base

#credentials, #options, #repo_contents_path, #source

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from FileFetchers::Base

#clone_repo_contents, #commit, #directory, #ecosystem_versions, #files, #initialize, #repo, #target_branch

Constructor Details

This class inherits a constructor from Dependabot::FileFetchers::Base

Class Method Details

.required_files_in?(filenames) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/dependabot/config/file_fetcher.rb', line 16

def self.required_files_in?(filenames)
  CONFIG_FILE_PATHS.any? { |file| filenames.include?(file) }
end

.required_files_messageObject



21
22
23
# File 'lib/dependabot/config/file_fetcher.rb', line 21

def self.required_files_message
  "Repo must contain either a #{CONFIG_FILE_PATHS.join(' or a ')} file"
end

Instance Method Details

#config_fileObject



26
27
28
# File 'lib/dependabot/config/file_fetcher.rb', line 26

def config_file
  @config_file ||= T.let(files.first, T.nilable(Dependabot::DependencyFile))
end