From 955f98a75285b573127982bf246d732fe6e6a0b5 Mon Sep 17 00:00:00 2001 From: Randhir Date: Tue, 14 Jan 2025 19:21:03 +0000 Subject: [PATCH] corrected return type --- python/lib/dependabot/python/file_parser.rb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/python/lib/dependabot/python/file_parser.rb b/python/lib/dependabot/python/file_parser.rb index 37724bac88..4c150f9481 100644 --- a/python/lib/dependabot/python/file_parser.rb +++ b/python/lib/dependabot/python/file_parser.rb @@ -198,14 +198,13 @@ def setup_python_environment nil end - sig { params(package_manager: String, version: String).void } + sig { params(package_manager: String, version: String).returns(T.nilable(T::Boolean)) } def log_if_version_malformed(package_manager, version) # logs warning if malformed version is found - return true if version.match?(/^\d+(?:\.\d+)*$/) - Dependabot.logger.warn( "Detected #{package_manager} with malformed version #{version}" ) + true if version.match?(/^\d+(?:\.\d+)*$/) end sig { returns(String) } @@ -366,13 +365,10 @@ def evaluate_condition(condition, python_version) end end - sig { void } + sig { returns(T.nilable(SetupFileParser)) } def setup_file_dependencies - @setup_file_dependencies ||= T.let( - SetupFileParser - .new(dependency_files: dependency_files) - .dependency_set, T.untyped - ) + @setup_file_dependencies ||= T.let(SetupFileParser.new(dependency_files: dependency_files) + .dependency_set, T.nilable(SetupFileParser)) end sig { returns(T.untyped) }