Skip to content

Commit

Permalink
chore: deprecate parser functions in favor of their extract equivalen…
Browse files Browse the repository at this point in the history
…ts (#1253)

I think it's time to start getting the word out...

Resolves #1021
  • Loading branch information
G-Rath authored Sep 18, 2024
1 parent 02dd87e commit 76a40a0
Show file tree
Hide file tree
Showing 22 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/lockfile/apk-installed.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func parseApkPackageGroup(group []string) PackageDetails {
return pkg
}

// Deprecated: use ApkInstalledExtractor.Extract instead
func ParseApkInstalled(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, ApkInstalledExtractor{})
}
Expand Down
1 change: 1 addition & 0 deletions pkg/lockfile/dpkg-status.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func parseDpkgPackageGroup(group []string) PackageDetails {
return pkg
}

// Deprecated: use DpkgStatusExtractor.Extract instead
func ParseDpkgStatus(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, DpkgStatusExtractor{})
}
Expand Down
1 change: 1 addition & 0 deletions pkg/lockfile/osv-vuln-results.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/google/osv-scanner/pkg/models"
)

// Deprecated: use OSVScannerResultsExtractor.Extract instead
func ParseOSVScannerResults(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, OSVScannerResultsExtractor{})
}
Expand Down
1 change: 1 addition & 0 deletions pkg/lockfile/parse-cargo-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func init() {
registerExtractor("Cargo.lock", CargoLockExtractor{})
}

// Deprecated: use CargoLockExtractor.Extract instead
func ParseCargoLock(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, CargoLockExtractor{})
}
1 change: 1 addition & 0 deletions pkg/lockfile/parse-composer-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func init() {
registerExtractor("composer.lock", ComposerLockExtractor{})
}

// Deprecated: use ComposerLockExtractor.Extract instead
func ParseComposerLock(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, ComposerLockExtractor{})
}
1 change: 1 addition & 0 deletions pkg/lockfile/parse-conan-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ func init() {
registerExtractor("conan.lock", ConanLockExtractor{})
}

// Deprecated: use ConanLockExtractor.Extract instead
func ParseConanLock(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, ConanLockExtractor{})
}
1 change: 1 addition & 0 deletions pkg/lockfile/parse-gemfile-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ func init() {
registerExtractor("Gemfile.lock", GemfileLockExtractor{})
}

// Deprecated: use GemfileLockExtractor.Extract instead
func ParseGemfileLock(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, GemfileLockExtractor{})
}
1 change: 1 addition & 0 deletions pkg/lockfile/parse-go-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ func init() {
registerExtractor("go.mod", GoLockExtractor{})
}

// Deprecated: use GoLockExtractor.Extract instead
func ParseGoLock(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, GoLockExtractor{})
}
1 change: 1 addition & 0 deletions pkg/lockfile/parse-gradle-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func init() {
registerExtractor("gradle.lockfile", GradleLockExtractor{})
}

// Deprecated: use GradleLockExtractor.Extract instead
func ParseGradleLock(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, GradleLockExtractor{})
}
1 change: 1 addition & 0 deletions pkg/lockfile/parse-gradle-verification-metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ func init() {
registerExtractor("gradle/verification-metadata.xml", GradleVerificationMetadataExtractor{})
}

// Deprecated: use GradleVerificationMetadataExtractor.Extract instead
func ParseGradleVerificationMetadata(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, GradleVerificationMetadataExtractor{})
}
1 change: 1 addition & 0 deletions pkg/lockfile/parse-maven-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ func init() {
registerExtractor("pom.xml", MavenLockExtractor{})
}

// Deprecated: use MavenLockExtractor.Extract instead
func ParseMavenLock(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, MavenLockExtractor{})
}
1 change: 1 addition & 0 deletions pkg/lockfile/parse-mix-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func init() {
registerExtractor("mix.lock", MixLockExtractor{})
}

// Deprecated: use MixLockExtractor.Extract instead
func ParseMixLock(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, MixLockExtractor{})
}
1 change: 1 addition & 0 deletions pkg/lockfile/parse-npm-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ func init() {
registerExtractor("package-lock.json", NpmLockExtractor{})
}

// Deprecated: use NpmLockExtractor.Extract instead
func ParseNpmLock(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, NpmLockExtractor{})
}
1 change: 1 addition & 0 deletions pkg/lockfile/parse-nuget-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ func init() {
registerExtractor("packages.lock.json", NuGetLockExtractor{})
}

// Deprecated: use NuGetLockExtractor.Extract instead
func ParseNuGetLock(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, NuGetLockExtractor{})
}
1 change: 1 addition & 0 deletions pkg/lockfile/parse-pdm-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func init() {
registerExtractor("pdm.lock", PdmLockExtractor{})
}

// Deprecated: use PdmLockExtractor.Extract instead
func ParsePdmLock(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, PdmLockExtractor{})
}
1 change: 1 addition & 0 deletions pkg/lockfile/parse-pipenv-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func init() {
registerExtractor("Pipfile.lock", PipenvLockExtractor{})
}

// Deprecated: use PipenvLockExtractor.Extract instead
func ParsePipenvLock(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, PipenvLockExtractor{})
}
1 change: 1 addition & 0 deletions pkg/lockfile/parse-pnpm-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ func init() {
registerExtractor("pnpm-lock.yaml", PnpmLockExtractor{})
}

// Deprecated: use PnpmLockExtractor.Extract instead
func ParsePnpmLock(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, PnpmLockExtractor{})
}
1 change: 1 addition & 0 deletions pkg/lockfile/parse-poetry-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ func init() {
registerExtractor("poetry.lock", PoetryLockExtractor{})
}

// Deprecated: use PoetryLockExtractor.Extract instead
func ParsePoetryLock(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, PoetryLockExtractor{})
}
1 change: 1 addition & 0 deletions pkg/lockfile/parse-pubspec-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func init() {
registerExtractor("pubspec.lock", PubspecLockExtractor{})
}

// Deprecated: use PubspecLockExtractor.Extract instead
func ParsePubspecLock(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, PubspecLockExtractor{})
}
1 change: 1 addition & 0 deletions pkg/lockfile/parse-renv-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func init() {
registerExtractor("renv.lock", RenvLockExtractor{})
}

// Deprecated: use RenvLockExtractor.Extract instead
func ParseRenvLock(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, RenvLockExtractor{})
}
1 change: 1 addition & 0 deletions pkg/lockfile/parse-requirements-txt.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ func init() {
registerExtractor("requirements.txt", RequirementsTxtExtractor{})
}

// Deprecated: use RequirementsTxtExtractor.Extract instead
func ParseRequirementsTxt(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, RequirementsTxtExtractor{})
}
1 change: 1 addition & 0 deletions pkg/lockfile/parse-yarn-lock.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ func init() {
registerExtractor("yarn.lock", YarnLockExtractor{})
}

// Deprecated: use YarnLockExtractor.Extract instead
func ParseYarnLock(pathToLockfile string) ([]PackageDetails, error) {
return extractFromFile(pathToLockfile, YarnLockExtractor{})
}

0 comments on commit 76a40a0

Please sign in to comment.