Clean up old configuration options (#1280)

* Clean up old configuration options

* Remove from package.json
This commit is contained in:
Bernie White 2023-11-11 17:19:06 +10:00 коммит произвёл GitHub
Родитель 94a0b1a1bd
Коммит d103b34699
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
8 изменённых файлов: 28 добавлений и 36 удалений

6
.vscode/launch.json поставляемый
Просмотреть файл

@ -13,6 +13,9 @@
"args": [ "args": [
"--disable-extension=bewhite.psrule-vscode-preview", "--disable-extension=bewhite.psrule-vscode-preview",
"--disable-extension=bewhite.psrule-vscode", "--disable-extension=bewhite.psrule-vscode",
"--disable-extension=ps-rule.vscode",
"--disable-extension=ps-rule.vscode-preview",
"--disable-extension=ps-rule.vscode-dev",
"--extensionDevelopmentPath=${workspaceFolder}" "--extensionDevelopmentPath=${workspaceFolder}"
], ],
"outFiles": [ "outFiles": [
@ -34,6 +37,9 @@
"args": [ "args": [
"--disable-extension=bewhite.psrule-vscode-preview", "--disable-extension=bewhite.psrule-vscode-preview",
"--disable-extension=bewhite.psrule-vscode", "--disable-extension=bewhite.psrule-vscode",
"--disable-extension=ps-rule.vscode",
"--disable-extension=ps-rule.vscode-preview",
"--disable-extension=ps-rule.vscode-dev",
"--extensionDevelopmentPath=${workspaceFolder}", "--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/dist/test/suite/index" "--extensionTestsPath=${workspaceFolder}/out/dist/test/suite/index"
], ],

Просмотреть файл

@ -130,13 +130,6 @@
"markdownDescription": "The name of a snippet to use when creating new rule documentation. By default, the built-in `Rule Doc` snippet will be used.", "markdownDescription": "The name of a snippet to use when creating new rule documentation. By default, the built-in `Rule Doc` snippet will be used.",
"scope": "window" "scope": "window"
}, },
"PSRule.execution.notProcessedWarning": {
"type": "boolean",
"default": false,
"description": "Warn when objects are not processed by any rule. Supported on PSRule < v3.",
"scope": "window",
"markdownDeprecationMessage": "This option is replaced by [Unprocessed Object](https://aka.ms/ps-rule/options#executionunprocessedobject) from PSRule v2.9.0. This option will be removed from PSRule v3."
},
"PSRule.execution.ruleExcluded": { "PSRule.execution.ruleExcluded": {
"type": "string", "type": "string",
"default": "None", "default": "None",

Просмотреть файл

@ -62,7 +62,7 @@ Write-Host -Object "[Pipeline] -- Using channelSuffix: $channelSuffix" -Foregrou
Write-Host -Object "[Pipeline] -- Using version: $version" -ForegroundColor Green; Write-Host -Object "[Pipeline] -- Using version: $version" -ForegroundColor Green;
$packageRoot = Join-Path -Path $OutputPath -ChildPath 'package'; $packageRoot = Join-Path -Path $OutputPath -ChildPath 'package';
$packageName = "psrule-vscode$channelSuffix"; $packageName = "vscode$channelSuffix";
$packagePath = Join-Path -Path $packageRoot -ChildPath "$packageName.vsix"; $packagePath = Join-Path -Path $packageRoot -ChildPath "$packageName.vsix";
function Get-RepoRuleData { function Get-RepoRuleData {
@ -168,8 +168,8 @@ task NuGet {
# Synopsis: Install PSRule # Synopsis: Install PSRule
task PSRule NuGet, { task PSRule NuGet, {
if ($Null -eq (Get-InstalledModule -Name PSRule -MinimumVersion 2.0.0 -ErrorAction Ignore)) { if ($Null -eq (Get-InstalledModule -Name PSRule -MinimumVersion 2.9.0 -ErrorAction Ignore)) {
Install-Module -Name PSRule -Repository PSGallery -MinimumVersion 2.0.0 -Scope CurrentUser -Force; Install-Module -Name PSRule -Repository PSGallery -MinimumVersion 2.9.0 -Scope CurrentUser -Force;
} }
Import-Module -Name PSRule -Verbose:$False; Import-Module -Name PSRule -Verbose:$False;
} }
@ -201,17 +201,10 @@ task ReleaseExtension {
exec { & npm run publish -- --packagePath $packagePath --pat $ApiKey } exec { & npm run publish -- --packagePath $packagePath --pat $ApiKey }
} }
# Synopsis: Add shipit build tag
task TagBuild {
if ($Null -ne $Env:BUILD_DEFINITIONNAME) {
Write-Host "`#`#vso[build.addbuildtag]shipit";
}
}
task Build Clean, PackageRestore, VersionExtension, PackageExtension task Build Clean, PackageRestore, VersionExtension, PackageExtension
task Install Build, InstallExtension task Install Build, InstallExtension
task . Build task . Build
task Release VersionExtension, ReleaseExtension, TagBuild task Release VersionExtension, ReleaseExtension

Просмотреть файл

@ -47,11 +47,21 @@ export interface ISetting {
documentationLocalePath: string; documentationLocalePath: string;
/** /**
* Execution options * Set `Execution.RuleExcluded`.
* See help: https://microsoft.github.io/PSRule/v3/concepts/PSRule/en-US/about_PSRule_Options/#executionruleexcluded
*/ */
executionNotProcessedWarning: boolean | undefined;
executionRuleExcluded: ExecutionActionPreference; executionRuleExcluded: ExecutionActionPreference;
/**
* Set `Execution.RuleSuppressed`.
* See help: https://microsoft.github.io/PSRule/v3/concepts/PSRule/en-US/about_PSRule_Options/#executionrulesuppressed
*/
executionRuleSuppressed: ExecutionActionPreference; executionRuleSuppressed: ExecutionActionPreference;
/**
* Set `Execution.UnprocessedObject`.
* See help: https://microsoft.github.io/PSRule/v3/concepts/PSRule/en-US/about_PSRule_Options/#executionunprocessedobject
*/
executionUnprocessedObject: ExecutionActionPreference; executionUnprocessedObject: ExecutionActionPreference;
/** /**
@ -77,7 +87,6 @@ const globalDefaults: ISetting = {
documentationSnippet: 'Rule Doc', documentationSnippet: 'Rule Doc',
documentationPath: undefined, documentationPath: undefined,
documentationLocalePath: env.language, documentationLocalePath: env.language,
executionNotProcessedWarning: undefined,
executionRuleExcluded: ExecutionActionPreference.None, executionRuleExcluded: ExecutionActionPreference.None,
executionRuleSuppressed: ExecutionActionPreference.None, executionRuleSuppressed: ExecutionActionPreference.None,
executionUnprocessedObject: ExecutionActionPreference.None, executionUnprocessedObject: ExecutionActionPreference.None,
@ -161,7 +170,6 @@ export class ConfigurationManager {
this.default.codeLensRuleDocumentationLinks this.default.codeLensRuleDocumentationLinks
); );
this.current.executionNotProcessedWarning = config.get<boolean>('execution.notProcessedWarning');
this.current.executionRuleExcluded = config.get<ExecutionActionPreference>('execution.ruleExcluded', this.default.executionRuleExcluded); this.current.executionRuleExcluded = config.get<ExecutionActionPreference>('execution.ruleExcluded', this.default.executionRuleExcluded);
this.current.executionRuleSuppressed = config.get<ExecutionActionPreference>('execution.ruleSuppressed', this.default.executionRuleSuppressed); this.current.executionRuleSuppressed = config.get<ExecutionActionPreference>('execution.ruleSuppressed', this.default.executionRuleSuppressed);
this.current.executionUnprocessedObject = config.get<ExecutionActionPreference>('execution.unprocessedObject', this.default.executionUnprocessedObject); this.current.executionUnprocessedObject = config.get<ExecutionActionPreference>('execution.unprocessedObject', this.default.executionUnprocessedObject);

Просмотреть файл

@ -163,16 +163,16 @@ export class ExtensionManager implements vscode.Disposable {
const extensionVersionKey = 'ps-rule-extension-version'; const extensionVersionKey = 'ps-rule-extension-version';
// Get channel // Get channel
let extensionId = 'bewhite.psrule-vscode'; let extensionId = 'ps-rule.vscode';
let extensionChannel = 'stable'; let extensionChannel = 'stable';
const isStableInstalled = vscode.extensions.getExtension(extensionId) !== undefined; const isStableInstalled = vscode.extensions.getExtension(extensionId) !== undefined;
if (path.basename(context.globalStorageUri.fsPath) === 'bewhite.psrule-vscode-preview') { if (path.basename(context.globalStorageUri.fsPath) === 'ps-rule.vscode-preview') {
extensionId = 'bewhite.psrule-vscode-preview'; extensionId = 'ps-rule.vscode-preview';
extensionChannel = 'preview'; extensionChannel = 'preview';
} }
if (path.basename(context.globalStorageUri.fsPath) === 'bewhite.psrule-vscode-dev') { if (path.basename(context.globalStorageUri.fsPath) === 'ps-rule.vscode-dev') {
extensionId = 'bewhite.psrule-vscode-dev'; extensionId = 'ps-rule.vscode-dev';
extensionChannel = 'dev'; extensionChannel = 'dev';
} }
logger.verbose(`Running extension channel: ${extensionChannel}`); logger.verbose(`Running extension channel: ${extensionChannel}`);

Просмотреть файл

@ -218,7 +218,6 @@ export class PSRuleTaskProvider implements vscode.TaskProvider {
}; };
} }
const executionNotProcessedWarning = configuration.get().executionNotProcessedWarning;
const executionRuleExcluded = configuration.get().executionRuleExcluded; const executionRuleExcluded = configuration.get().executionRuleExcluded;
const executionRuleSuppressed = configuration.get().executionRuleSuppressed; const executionRuleSuppressed = configuration.get().executionRuleSuppressed;
const executionUnprocessedObject = configuration.get().executionUnprocessedObject; const executionUnprocessedObject = configuration.get().executionUnprocessedObject;
@ -303,12 +302,6 @@ export class PSRuleTaskProvider implements vscode.TaskProvider {
PSRULE_OUTPUT_BANNER: 'Minimal', PSRULE_OUTPUT_BANNER: 'Minimal',
}; };
if (executionNotProcessedWarning !== undefined) {
taskEnv.PSRULE_EXECUTION_NOTPROCESSEDWARNING = executionNotProcessedWarning
? 'true'
: 'false';
}
if (executionRuleExcluded !== undefined && executionRuleExcluded !== ExecutionActionPreference.None) { if (executionRuleExcluded !== undefined && executionRuleExcluded !== ExecutionActionPreference.None) {
taskEnv.PSRULE_EXECUTION_RULEEXCLUDED = executionRuleExcluded; taskEnv.PSRULE_EXECUTION_RULEEXCLUDED = executionRuleExcluded;
} }

Просмотреть файл

@ -13,7 +13,6 @@ suite('ConfigurationManager tests', () => {
assert.equal(config.get().documentationLocalePath, 'en'); assert.equal(config.get().documentationLocalePath, 'en');
assert.equal(config.get().documentationPath, undefined); assert.equal(config.get().documentationPath, undefined);
assert.equal(config.get().documentationSnippet, 'Rule Doc'); assert.equal(config.get().documentationSnippet, 'Rule Doc');
assert.equal(config.get().executionNotProcessedWarning, undefined);
assert.equal(config.get().executionRuleExcluded, ExecutionActionPreference.None); assert.equal(config.get().executionRuleExcluded, ExecutionActionPreference.None);
assert.equal(config.get().executionRuleSuppressed, ExecutionActionPreference.None); assert.equal(config.get().executionRuleSuppressed, ExecutionActionPreference.None);
assert.equal(config.get().executionUnprocessedObject, ExecutionActionPreference.None); assert.equal(config.get().executionUnprocessedObject, ExecutionActionPreference.None);

Просмотреть файл

@ -10,7 +10,7 @@ suite('Extension tests', () => {
.then((info) => { .then((info) => {
assert.strictEqual('dev', info.channel); assert.strictEqual('dev', info.channel);
assert.strictEqual('0.0.1', info.version); assert.strictEqual('0.0.1', info.version);
assert.strictEqual('bewhite.psrule-vscode-dev', info.id); assert.strictEqual('ps-rule.vscode-dev', info.id);
}) })
.catch((reason) => { .catch((reason) => {
assert.fail(`Failed to get extension info. ${reason}`); assert.fail(`Failed to get extension info. ${reason}`);