From 4c3b03c060fd3cef533b9c4b46f1299de57e5352 Mon Sep 17 00:00:00 2001 From: Ryo Date: Wed, 24 May 2023 23:07:05 +0900 Subject: [PATCH] refactor: Replace unknown-version skipReason with unspecified-version --- lib/modules/manager/cocoapods/extract.spec.ts | 8 ++--- lib/modules/manager/cocoapods/extract.ts | 2 +- .../__snapshots__/extract.spec.ts.snap | 2 +- .../manager/gitlabci-include/extract.ts | 2 +- lib/modules/manager/gradle/extract.spec.ts | 2 +- lib/modules/manager/gradle/extract/catalog.ts | 2 +- lib/modules/manager/gradle/parser.spec.ts | 32 +++++++++---------- lib/modules/manager/gradle/parser/handlers.ts | 10 +++--- .../extract/__snapshots__/index.spec.ts.snap | 20 ++++++------ lib/modules/manager/npm/extract/index.spec.ts | 18 +++++------ lib/modules/manager/npm/extract/index.ts | 10 +++--- .../poetry/__snapshots__/extract.spec.ts.snap | 2 +- lib/modules/manager/poetry/extract.ts | 2 +- lib/types/skip-reason.ts | 1 - 14 files changed, 56 insertions(+), 57 deletions(-) diff --git a/lib/modules/manager/cocoapods/extract.spec.ts b/lib/modules/manager/cocoapods/extract.spec.ts index e5dcf9850c8ea7..ecef3e295e3e19 100644 --- a/lib/modules/manager/cocoapods/extract.spec.ts +++ b/lib/modules/manager/cocoapods/extract.spec.ts @@ -62,16 +62,16 @@ describe('modules/manager/cocoapods/extract', () => { { depName: 'TOCropViewController', currentValue: '~> 2.5.1' }, { depName: 'FMDB', currentValue: '~> 2.7.5' }, { depName: 'FDStackView', currentValue: '~> 1.0.1' }, - { depName: 'LYEmptyView', skipReason: 'unknown-version' }, + { depName: 'LYEmptyView', skipReason: 'unspecified-version' }, { depName: 'MMKV', currentValue: '~> 1.0.22' }, - { depName: 'fishhook', skipReason: 'unknown-version' }, + { depName: 'fishhook', skipReason: 'unspecified-version' }, { depName: 'CocoaLumberjack', currentValue: '~> 3.5.3' }, { depName: 'GZIP', currentValue: '~> 1.2' }, { depName: 'LBXScan/LBXNative', currentValue: '~> 2.3' }, { depName: 'LBXScan/LBXZXing', currentValue: '~> 2.3' }, { depName: 'LBXScan/UI', currentValue: '~> 2.3' }, - { depName: 'MLeaksFinder', skipReason: 'unknown-version' }, - { depName: 'FBMemoryProfiler', skipReason: 'unknown-version' }, + { depName: 'MLeaksFinder', skipReason: 'unspecified-version' }, + { depName: 'FBMemoryProfiler', skipReason: 'unspecified-version' }, ]); }); }); diff --git a/lib/modules/manager/cocoapods/extract.ts b/lib/modules/manager/cocoapods/extract.ts index ddb17826e75413..fb371633704a3c 100644 --- a/lib/modules/manager/cocoapods/extract.ts +++ b/lib/modules/manager/cocoapods/extract.ts @@ -112,7 +112,7 @@ export async function extractPackageFile( let dep: PackageDependency = { depName, groupName, - skipReason: 'unknown-version', + skipReason: 'unspecified-version', }; if (currentValue) { diff --git a/lib/modules/manager/gitlabci-include/__snapshots__/extract.spec.ts.snap b/lib/modules/manager/gitlabci-include/__snapshots__/extract.spec.ts.snap index 1078afcb26dabe..986b82e20fb333 100644 --- a/lib/modules/manager/gitlabci-include/__snapshots__/extract.spec.ts.snap +++ b/lib/modules/manager/gitlabci-include/__snapshots__/extract.spec.ts.snap @@ -18,7 +18,7 @@ exports[`modules/manager/gitlabci-include/extract extractPackageFile() extracts "datasource": "gitlab-tags", "depName": "mikebryant/include-source-example3", "depType": "repository", - "skipReason": "unknown-version", + "skipReason": "unspecified-version", }, ] `; diff --git a/lib/modules/manager/gitlabci-include/extract.ts b/lib/modules/manager/gitlabci-include/extract.ts index a677d8f5b70da7..a18c2d6ef0a2ad 100644 --- a/lib/modules/manager/gitlabci-include/extract.ts +++ b/lib/modules/manager/gitlabci-include/extract.ts @@ -26,7 +26,7 @@ function extractDepFromIncludeFile( depType: 'repository', }; if (!includeObj.ref) { - dep.skipReason = 'unknown-version'; + dep.skipReason = 'unspecified-version'; return dep; } dep.currentValue = includeObj.ref; diff --git a/lib/modules/manager/gradle/extract.spec.ts b/lib/modules/manager/gradle/extract.spec.ts index cd0c503511dc83..fd9f6f409e40d1 100644 --- a/lib/modules/manager/gradle/extract.spec.ts +++ b/lib/modules/manager/gradle/extract.spec.ts @@ -604,7 +604,7 @@ describe('modules/manager/gradle/extract', () => { packageFile: 'gradle/libs.versions.toml', }, registryUrls: ['https://plugins.gradle.org/m2/'], - skipReason: 'unknown-version', + skipReason: 'unspecified-version', }, ], }, diff --git a/lib/modules/manager/gradle/extract/catalog.ts b/lib/modules/manager/gradle/extract/catalog.ts index e462e9c3d90bdf..7061d8e8d4181c 100644 --- a/lib/modules/manager/gradle/extract/catalog.ts +++ b/lib/modules/manager/gradle/extract/catalog.ts @@ -151,7 +151,7 @@ function extractLiteralVersion({ } } - return { skipReason: 'unknown-version' }; + return { skipReason: 'unspecified-version' }; } function extractDependency({ diff --git a/lib/modules/manager/gradle/parser.spec.ts b/lib/modules/manager/gradle/parser.spec.ts index fe948df16dd442..ec46915bf96469 100644 --- a/lib/modules/manager/gradle/parser.spec.ts +++ b/lib/modules/manager/gradle/parser.spec.ts @@ -435,8 +435,8 @@ describe('modules/manager/gradle/parser', () => { ${'baz = "1.2.3"'} | ${'kotlin("foo", baz)'} | ${{ ...output, groupName: 'baz' }} ${'baz = "1.2.3"'} | ${'kotlin("foo", version = baz)'} | ${output} ${'baz = "1.2.3"'} | ${'kotlin("foo", property("baz"))'} | ${output} - ${'baz = "1.2.3"'} | ${'kotlin("foo", "${baz}456")'} | ${{ skipReason: 'unknown-version' }} - ${'baz = "1.2.3"'} | ${'kotlin("foo", baz + "456")'} | ${{ skipReason: 'unknown-version' }} + ${'baz = "1.2.3"'} | ${'kotlin("foo", "${baz}456")'} | ${{ skipReason: 'unspecified-version' }} + ${'baz = "1.2.3"'} | ${'kotlin("foo", baz + "456")'} | ${{ skipReason: 'unspecified-version' }} ${''} | ${'kotlin("foo", some)'} | ${null} ${''} | ${'kotlin(["foo", "1.2.3"])'} | ${null} ${''} | ${'kotlin("foo", "1.2.3", "4.5.6")'} | ${null} @@ -458,7 +458,7 @@ describe('modules/manager/gradle/parser', () => { ${'some = "foo"'} | ${'group: some, name: some, version: "1.2.3"'} | ${{ depName: 'foo:foo', currentValue: '1.2.3' }} ${'some = "foo"'} | ${'group: "${some}", name: "${some}", version: "1.2.3"'} | ${{ depName: 'foo:foo', currentValue: '1.2.3' }} ${'baz = "1.2.3"'} | ${'group: "foo", name: "bar", version: "${baz}"'} | ${{ depName: 'foo:bar', currentValue: '1.2.3', groupName: 'baz' }} - ${'baz = "1.2.3"'} | ${'group: "foo", name: "bar", version: "${baz}456"'} | ${{ depName: 'foo:bar', skipReason: 'unknown-version' }} + ${'baz = "1.2.3"'} | ${'group: "foo", name: "bar", version: "${baz}456"'} | ${{ depName: 'foo:bar', skipReason: 'unspecified-version' }} ${''} | ${'(group: "foo", name: "bar", version: "1.2.3", classifier: "sources")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }} ${''} | ${'(group: "foo", name: "bar", version: "1.2.3") {exclude module: "spring-jcl"}'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }} ${''} | ${"implementation platform(group: 'foo', name: 'bar', version: '1.2.3')"} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }} @@ -468,8 +468,8 @@ describe('modules/manager/gradle/parser', () => { ${'some = "foo"'} | ${'(group = "${some}", name = "${some}", version = "1.2.3")'} | ${{ depName: 'foo:foo', currentValue: '1.2.3' }} ${'some = "foo"'} | ${'(group = "${some}" + some, name = some + "bar" + some, version = "1.2.3")'} | ${{ depName: 'foofoo:foobarfoo', currentValue: '1.2.3' }} ${'baz = "1.2.3"'} | ${'(group = "foo", name = "bar", version = "${baz}")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3', groupName: 'baz' }} - ${'baz = "1.2.3"'} | ${'(group = "foo", name = "bar", version = "${baz}456")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3456', skipReason: 'unknown-version' }} - ${'baz = "1.2.3"'} | ${'(group = "foo", name = "bar", version = baz + "456")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3456', skipReason: 'unknown-version' }} + ${'baz = "1.2.3"'} | ${'(group = "foo", name = "bar", version = "${baz}456")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3456', skipReason: 'unspecified-version' }} + ${'baz = "1.2.3"'} | ${'(group = "foo", name = "bar", version = baz + "456")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3456', skipReason: 'unspecified-version' }} ${''} | ${'(group = "foo", name = "bar", version = "1.2.3", changing: true)'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }} `('$def | $str', ({ def, str, output }) => { const { deps } = parseGradle([def, str].join('\n')); @@ -563,16 +563,16 @@ describe('modules/manager/gradle/parser', () => { ${''} | ${'id "foo".version("1.2.3")'} | ${null} ${''} | ${'id("foo.bar") version("1.2.3")'} | ${{ depName: 'foo.bar', packageName: 'foo.bar:foo.bar.gradle.plugin', currentValue: '1.2.3' }} ${''} | ${'id("foo.bar") version "1.2.3"'} | ${{ depName: 'foo.bar', packageName: 'foo.bar:foo.bar.gradle.plugin', currentValue: '1.2.3' }} - ${''} | ${'id "foo.bar" version "$baz"'} | ${{ depName: 'foo.bar', skipReason: 'unknown-version', currentValue: 'baz' }} + ${''} | ${'id "foo.bar" version "$baz"'} | ${{ depName: 'foo.bar', skipReason: 'unspecified-version', currentValue: 'baz' }} ${'baz = "1.2.3"'} | ${'id "foo.bar" version "$baz"'} | ${{ depName: 'foo.bar', packageName: 'foo.bar:foo.bar.gradle.plugin', currentValue: '1.2.3', groupName: 'baz' }} ${'baz = "1.2.3"'} | ${'id("foo.bar") version "$baz"'} | ${{ depName: 'foo.bar', packageName: 'foo.bar:foo.bar.gradle.plugin', currentValue: '1.2.3' }} - ${''} | ${'id "foo.bar" version "x${ab}cd"'} | ${{ depName: 'foo.bar', skipReason: 'unknown-version' }} - ${''} | ${'id("foo.bar") version "$baz"'} | ${{ depName: 'foo.bar', skipReason: 'unknown-version', currentValue: 'baz' }} - ${''} | ${'id("foo.bar") version "x${ab}cd"'} | ${{ depName: 'foo.bar', skipReason: 'unknown-version' }} - ${''} | ${'id("foo.bar") version "1" + "2.3"'} | ${{ depName: 'foo.bar', skipReason: 'unknown-version' }} - ${''} | ${'id("foo.bar") version property("qux")'} | ${{ depName: 'foo.bar', skipReason: 'unknown-version' }} + ${''} | ${'id "foo.bar" version "x${ab}cd"'} | ${{ depName: 'foo.bar', skipReason: 'unspecified-version' }} + ${''} | ${'id("foo.bar") version "$baz"'} | ${{ depName: 'foo.bar', skipReason: 'unspecified-version', currentValue: 'baz' }} + ${''} | ${'id("foo.bar") version "x${ab}cd"'} | ${{ depName: 'foo.bar', skipReason: 'unspecified-version' }} + ${''} | ${'id("foo.bar") version "1" + "2.3"'} | ${{ depName: 'foo.bar', skipReason: 'unspecified-version' }} + ${''} | ${'id("foo.bar") version property("qux")'} | ${{ depName: 'foo.bar', skipReason: 'unspecified-version' }} ${'baz = "1.2.3"'} | ${'id("foo.bar") version property("baz")'} | ${{ depName: 'foo.bar', packageName: 'foo.bar:foo.bar.gradle.plugin', currentValue: '1.2.3' }} - ${''} | ${'id "foo.bar" version baz'} | ${{ depName: 'foo.bar', currentValue: 'baz', skipReason: 'unknown-version' }} + ${''} | ${'id "foo.bar" version baz'} | ${{ depName: 'foo.bar', currentValue: 'baz', skipReason: 'unspecified-version' }} ${'baz = "1.2.3"'} | ${'id "foo.bar" version baz'} | ${{ depName: 'foo.bar', packageName: 'foo.bar:foo.bar.gradle.plugin', currentValue: '1.2.3' }} ${'baz = "1.2.3"'} | ${'id("foo.bar") version baz'} | ${{ depName: 'foo.bar', packageName: 'foo.bar:foo.bar.gradle.plugin', currentValue: '1.2.3' }} ${'baz = "1.2.3"'} | ${'id("foo.bar").version(baz)'} | ${{ depName: 'foo.bar', packageName: 'foo.bar:foo.bar.gradle.plugin', currentValue: '1.2.3' }} @@ -709,8 +709,8 @@ describe('modules/manager/gradle/parser', () => { ${'baz = "1.2.3"'} | ${'library("foo.bar", "foo", "bar").version(baz)'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }} ${'baz = "1.2.3"'} | ${'library("foo.bar", "foo", "bar").version("${baz}")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }} ${'baz = "1.2.3"'} | ${'library("foo.bar", "foo", "bar").version(property("baz"))'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }} - ${'baz = "1.2.3"'} | ${'library("foo.bar", "foo", "bar").version("${baz}xy")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3xy', skipReason: 'unknown-version' }} - ${'baz = "1.2.3"'} | ${'library("foo.bar", "foo", "bar").version(baz + ".45")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3.45', skipReason: 'unknown-version' }} + ${'baz = "1.2.3"'} | ${'library("foo.bar", "foo", "bar").version("${baz}xy")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3xy', skipReason: 'unspecified-version' }} + ${'baz = "1.2.3"'} | ${'library("foo.bar", "foo", "bar").version(baz + ".45")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3.45', skipReason: 'unspecified-version' }} ${'group = "foo"; artifact = "bar"'} | ${'library("foo.bar", group, artifact).version("1.2.3")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }} ${'f = "foo"; b = "bar"'} | ${'library("foo.bar", "${f}", "${b}").version("1.2.3")'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }} ${'f = "foo"; b = "bar"; v = "1.2.3"'} | ${'library("foo.bar", property("f"), "${b}").version(v)'} | ${{ depName: 'foo:bar', currentValue: '1.2.3' }} @@ -919,8 +919,8 @@ describe('modules/manager/gradle/parser', () => { ${''} | ${'spotbugs { toolVersion = "1.2.3" }'} | ${{ depName: 'spotbugs', packageName: GRADLE_PLUGINS['spotbugs'][1], currentValue: '1.2.3' }} ${''} | ${'pmd { toolVersion = "@@@" }'} | ${null} ${''} | ${'pmd { toolVersion = "${baz}" }'} | ${null} - ${'baz = "1.2.3"'} | ${'pmd { toolVersion = "${baz}.456" }'} | ${{ depName: 'pmd', currentValue: '1.2.3.456', skipReason: 'unknown-version' }} - ${'baz = "1.2.3"'} | ${'pmd { toolVersion = baz + ".456" }'} | ${{ depName: 'pmd', currentValue: '1.2.3.456', skipReason: 'unknown-version' }} + ${'baz = "1.2.3"'} | ${'pmd { toolVersion = "${baz}.456" }'} | ${{ depName: 'pmd', currentValue: '1.2.3.456', skipReason: 'unspecified-version' }} + ${'baz = "1.2.3"'} | ${'pmd { toolVersion = baz + ".456" }'} | ${{ depName: 'pmd', currentValue: '1.2.3.456', skipReason: 'unspecified-version' }} ${''} | ${'pmd { [toolVersion = "6.36.0"] }'} | ${null} ${''} | ${'unknown { toolVersion = "1.2.3" }'} | ${null} ${''} | ${'composeOptions { kotlinCompilerExtensionVersion = "1.2.3" }'} | ${{ depName: 'composeOptions', packageName: GRADLE_PLUGINS['composeOptions'][1], currentValue: '1.2.3' }} diff --git a/lib/modules/manager/gradle/parser/handlers.ts b/lib/modules/manager/gradle/parser/handlers.ts index 273ffeabbe09bc..15501cadbecdc0 100644 --- a/lib/modules/manager/gradle/parser/handlers.ts +++ b/lib/modules/manager/gradle/parser/handlers.ts @@ -139,7 +139,7 @@ export function handleKotlinShortNotationDep(ctx: Ctx): Ctx { if (versionTokens.length > 1) { // = template string with multiple variables - dep.skipReason = 'unknown-version'; + dep.skipReason = 'unspecified-version'; } else if (versionTokens[0].type === 'symbol') { const varData = findVariable(versionTokens[0].value, ctx); if (varData) { @@ -177,7 +177,7 @@ export function handleLongFormDep(ctx: Ctx): Ctx { const methodName = ctx.tokenMap.methodName ?? null; if (versionTokens.length > 1) { // = template string with multiple variables - dep.skipReason = 'unknown-version'; + dep.skipReason = 'unspecified-version'; } else if (versionTokens[0].type === 'symbol') { const varData = findVariable(versionTokens[0].value, ctx); if (varData) { @@ -227,7 +227,7 @@ export function handlePlugin(ctx: Ctx): Ctx { if (pluginVersion.length > 1) { // = template string with multiple variables - dep.skipReason = 'unknown-version'; + dep.skipReason = 'unspecified-version'; } else if (pluginVersion[0].type === 'symbol') { const varData = findVariable(pluginVersion[0].value, ctx); if (varData) { @@ -238,7 +238,7 @@ export function handlePlugin(ctx: Ctx): Ctx { packageFile: varData.packageFile, }; } else { - dep.skipReason = 'unknown-version'; + dep.skipReason = 'unspecified-version'; } } @@ -409,7 +409,7 @@ export function handleImplicitGradlePlugin(ctx: Ctx): Ctx { if (versionTokens.length > 1) { // = template string with multiple variables - dep.skipReason = 'unknown-version'; + dep.skipReason = 'unspecified-version'; } else if (versionTokens[0].type === 'symbol') { const varData = findVariable(versionTokens[0].value, ctx); if (varData) { diff --git a/lib/modules/manager/npm/extract/__snapshots__/index.spec.ts.snap b/lib/modules/manager/npm/extract/__snapshots__/index.spec.ts.snap index 06e92a81a48d4c..c73d244dfa945e 100644 --- a/lib/modules/manager/npm/extract/__snapshots__/index.spec.ts.snap +++ b/lib/modules/manager/npm/extract/__snapshots__/index.spec.ts.snap @@ -73,7 +73,7 @@ exports[`modules/manager/npm/extract/index .extractPackageFile() extracts engine "depName": "other", "depType": "devDependencies", "prettyDepType": "devDependency", - "skipReason": "unknown-version", + "skipReason": "unspecified-version", }, { "currentValue": ">=1.7.0 <2.0.0", @@ -115,7 +115,7 @@ exports[`modules/manager/npm/extract/index .extractPackageFile() extracts engine "depName": "yarn", "depType": "engines", "prettyDepType": "engine", - "skipReason": "unknown-version", + "skipReason": "unspecified-version", }, { "currentValue": ">=1.49.3", @@ -159,7 +159,7 @@ exports[`modules/manager/npm/extract/index .extractPackageFile() extracts non-np "depName": "a", "depType": "dependencies", "prettyDepType": "dependency", - "skipReason": "unknown-version", + "skipReason": "unspecified-version", }, { "currentValue": "github:owner/b#master", @@ -216,28 +216,28 @@ exports[`modules/manager/npm/extract/index .extractPackageFile() extracts non-np "depName": "g", "depType": "dependencies", "prettyDepType": "dependency", - "skipReason": "unknown-version", + "skipReason": "unspecified-version", }, { "currentValue": "github:-hello/world#v1.0.0", "depName": "h", "depType": "dependencies", "prettyDepType": "dependency", - "skipReason": "unknown-version", + "skipReason": "unspecified-version", }, { "currentValue": "@foo/bar#v2.0.0", "depName": "i", "depType": "dependencies", "prettyDepType": "dependency", - "skipReason": "unknown-version", + "skipReason": "unspecified-version", }, { "currentValue": "github:frank#v0.0.1", "depName": "j", "depType": "dependencies", "prettyDepType": "dependency", - "skipReason": "unknown-version", + "skipReason": "unspecified-version", }, { "currentDigest": "49b5aca", @@ -358,7 +358,7 @@ exports[`modules/manager/npm/extract/index .extractPackageFile() extracts npm pa "depType": "dependencies", "npmPackageAlias": true, "prettyDepType": "dependency", - "skipReason": "unknown-version", + "skipReason": "unspecified-version", }, ], "extractedConstraints": {}, @@ -481,7 +481,7 @@ exports[`modules/manager/npm/extract/index .extractPackageFile() extracts volta } `; -exports[`modules/manager/npm/extract/index .extractPackageFile() extracts volta yarn unknown-version 1`] = ` +exports[`modules/manager/npm/extract/index .extractPackageFile() extracts volta yarn unspecified-version 1`] = ` { "deps": [ { @@ -511,7 +511,7 @@ exports[`modules/manager/npm/extract/index .extractPackageFile() extracts volta "depName": "yarn", "depType": "volta", "prettyDepType": "volta", - "skipReason": "unknown-version", + "skipReason": "unspecified-version", }, ], "extractedConstraints": { diff --git a/lib/modules/manager/npm/extract/index.spec.ts b/lib/modules/manager/npm/extract/index.spec.ts index 6013a242400032..d43e4702551c73 100644 --- a/lib/modules/manager/npm/extract/index.spec.ts +++ b/lib/modules/manager/npm/extract/index.spec.ts @@ -435,7 +435,7 @@ describe('modules/manager/npm/extract/index', () => { { depName: 'other', currentValue: 'latest', - skipReason: 'unknown-version', + skipReason: 'unspecified-version', }, { depName: 'atom', @@ -467,7 +467,7 @@ describe('modules/manager/npm/extract/index', () => { currentValue: 'disabled', datasource: 'npm', depType: 'engines', - skipReason: 'unknown-version', + skipReason: 'unspecified-version', }, { depName: 'vscode', @@ -512,7 +512,7 @@ describe('modules/manager/npm/extract/index', () => { }); }); - it('extracts volta yarn unknown-version', async () => { + it('extracts volta yarn unspecified-version', async () => { const pJson = { main: 'index.js', engines: { @@ -549,7 +549,7 @@ describe('modules/manager/npm/extract/index', () => { depName: 'yarn', depType: 'volta', prettyDepType: 'volta', - skipReason: 'unknown-version', + skipReason: 'unspecified-version', }, ], }); @@ -628,7 +628,7 @@ describe('modules/manager/npm/extract/index', () => { ); expect(res).toMatchSnapshot({ deps: [ - { depName: 'a', skipReason: 'unknown-version' }, + { depName: 'a', skipReason: 'unspecified-version' }, { depName: 'b', skipReason: 'unversioned-reference' }, { depName: 'c', @@ -657,22 +657,22 @@ describe('modules/manager/npm/extract/index', () => { { depName: 'g', currentValue: 'gitlab:owner/g#v1.0.0', - skipReason: 'unknown-version', + skipReason: 'unspecified-version', }, { depName: 'h', currentValue: 'github:-hello/world#v1.0.0', - skipReason: 'unknown-version', + skipReason: 'unspecified-version', }, { depName: 'i', currentValue: '@foo/bar#v2.0.0', - skipReason: 'unknown-version', + skipReason: 'unspecified-version', }, { depName: 'j', currentValue: 'github:frank#v0.0.1', - skipReason: 'unknown-version', + skipReason: 'unspecified-version', }, { depName: 'k', diff --git a/lib/modules/manager/npm/extract/index.ts b/lib/modules/manager/npm/extract/index.ts index 4af1aefdcaa7cb..beed99ef98d67d 100644 --- a/lib/modules/manager/npm/extract/index.ts +++ b/lib/modules/manager/npm/extract/index.ts @@ -242,7 +242,7 @@ export async function extractPackageFile( dep.skipReason = 'unknown-engines'; } if (!isValid(dep.currentValue)) { - dep.skipReason = 'unknown-version'; + dep.skipReason = 'unspecified-version'; } return dep; } @@ -267,7 +267,7 @@ export async function extractPackageFile( dep.skipReason = 'unknown-volta'; } if (!isValid(dep.currentValue)) { - dep.skipReason = 'unknown-version'; + dep.skipReason = 'unspecified-version'; } return dep; } @@ -306,7 +306,7 @@ export async function extractPackageFile( } const hashSplit = dep.currentValue.split('#'); if (hashSplit.length !== 2) { - dep.skipReason = 'unknown-version'; + dep.skipReason = 'unspecified-version'; return dep; } const [depNamePart, depRefPart] = hashSplit; @@ -323,7 +323,7 @@ export async function extractPackageFile( .replace(regEx(/\.git$/), ''); const githubRepoSplit = githubOwnerRepo.split('/'); if (githubRepoSplit.length !== 2) { - dep.skipReason = 'unknown-version'; + dep.skipReason = 'unspecified-version'; return dep; } [githubOwner, githubRepo] = githubRepoSplit; @@ -337,7 +337,7 @@ export async function extractPackageFile( !githubValidRegex.test(githubOwner) || !githubValidRegex.test(githubRepo) ) { - dep.skipReason = 'unknown-version'; + dep.skipReason = 'unspecified-version'; return dep; } if (isVersion(depRefPart)) { diff --git a/lib/modules/manager/poetry/__snapshots__/extract.spec.ts.snap b/lib/modules/manager/poetry/__snapshots__/extract.spec.ts.snap index b42a6a577429b6..4265b8669acacc 100644 --- a/lib/modules/manager/poetry/__snapshots__/extract.spec.ts.snap +++ b/lib/modules/manager/poetry/__snapshots__/extract.spec.ts.snap @@ -494,7 +494,7 @@ exports[`modules/manager/poetry/extract extractPackageFile() extracts multiple d "nestedVersion": false, }, "packageName": "dev-dep2", - "skipReason": "unknown-version", + "skipReason": "unspecified-version", }, { "currentValue": "^0.8.3", diff --git a/lib/modules/manager/poetry/extract.ts b/lib/modules/manager/poetry/extract.ts index 13daf4ace31a5f..a31a0f0a41c944 100644 --- a/lib/modules/manager/poetry/extract.ts +++ b/lib/modules/manager/poetry/extract.ts @@ -119,7 +119,7 @@ function extractFromSection( } else if (poetryVersioning.isValid(currentValue)) { dep.versioning = poetryVersioning.id; } else { - dep.skipReason = 'unknown-version'; + dep.skipReason = 'unspecified-version'; } deps.push(dep); } diff --git a/lib/types/skip-reason.ts b/lib/types/skip-reason.ts index a94117c3d113b5..5517d34c0c8563 100644 --- a/lib/types/skip-reason.ts +++ b/lib/types/skip-reason.ts @@ -30,7 +30,6 @@ export type SkipReason = | 'placeholder-url' | 'unknown-engines' | 'unknown-registry' - | 'unknown-version' | 'unknown-volta' | 'unspecified-version' | 'unsupported-chart-type'