Skip to content

Commit

Permalink
Use NOT-APPLICABLE for unknown info
Browse files Browse the repository at this point in the history
  • Loading branch information
amazimbe committed Nov 15, 2024
1 parent 8da8e38 commit 35036cd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 15 deletions.
16 changes: 2 additions & 14 deletions maven/lib/dependabot/maven/file_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,30 +63,18 @@ def ecosystem
sig { returns(Ecosystem::VersionManager) }
def package_manager
@package_manager ||= T.let(
PackageManager.new(maven_version),
PackageManager.new("NOT-AVAILABLE"),
T.nilable(Dependabot::Maven::PackageManager)
)
end

sig { returns(T.nilable(Ecosystem::VersionManager)) }
def language
@language ||= T.let(begin
return if package_manager.unsupported?

Language.new(ruby_version)
Language.new("NOT-AVAILABLE")
end, T.nilable(Dependabot::Maven::Language))
end

sig { returns(String) }
def ruby_version
@ruby_version ||= T.let(RUBY_VERSION, T.nilable(String))
end

sig { returns(String) }
def maven_version
""
end

sig { params(pom: Dependabot::DependencyFile).returns(DependencySet) }
def pomfile_dependencies(pom)
dependency_set = DependencySet.new
Expand Down
12 changes: 11 additions & 1 deletion maven/lib/dependabot/maven/package_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module Maven
PACKAGE_MANAGER = "maven"

# Supported versions specified here: https://maven.apache.org/docs/history.html
SUPPORTED_MAVEN_VERSIONS = T.let([Version.new("3.6.3")].freeze, T::Array[Dependabot::Version])
SUPPORTED_MAVEN_VERSIONS = T.let([Version.new("3")].freeze, T::Array[Dependabot::Version])

# When a version is going to be unsupported, it will be added here
DEPRECATED_MAVEN_VERSIONS = T.let([].freeze, T::Array[Dependabot::Version])
Expand All @@ -35,6 +35,16 @@ def initialize(raw_version, requirement = nil)
requirement,
)
end

sig { returns(T::Boolean) }
def deprecated?
false
end

sig { returns(T::Boolean) }
def unsupported?
false
end
end
end
end

0 comments on commit 35036cd

Please sign in to comment.