Skip to content

Commit

Permalink
corrected return type
Browse files Browse the repository at this point in the history
  • Loading branch information
randhircs committed Jan 14, 2025
1 parent 34a78c7 commit 955f98a
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions python/lib/dependabot/python/file_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
Expand Down Expand Up @@ -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) }
Expand Down

0 comments on commit 955f98a

Please sign in to comment.