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": [
"--disable-extension=bewhite.psrule-vscode-preview",
"--disable-extension=bewhite.psrule-vscode",
"--disable-extension=ps-rule.vscode",
"--disable-extension=ps-rule.vscode-preview",
"--disable-extension=ps-rule.vscode-dev",
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
@ -34,6 +37,9 @@
"args": [
"--disable-extension=bewhite.psrule-vscode-preview",
"--disable-extension=bewhite.psrule-vscode",
"--disable-extension=ps-rule.vscode",
"--disable-extension=ps-rule.vscode-preview",
"--disable-extension=ps-rule.vscode-dev",
"--extensionDevelopmentPath=${workspaceFolder}",
"--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.",
"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": {
"type": "string",
"default": "None",

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

@ -62,7 +62,7 @@ Write-Host -Object "[Pipeline] -- Using channelSuffix: $channelSuffix" -Foregrou
Write-Host -Object "[Pipeline] -- Using version: $version" -ForegroundColor Green;
$packageRoot = Join-Path -Path $OutputPath -ChildPath 'package';
$packageName = "psrule-vscode$channelSuffix";
$packageName = "vscode$channelSuffix";
$packagePath = Join-Path -Path $packageRoot -ChildPath "$packageName.vsix";
function Get-RepoRuleData {
@ -168,8 +168,8 @@ task NuGet {
# Synopsis: Install PSRule
task PSRule NuGet, {
if ($Null -eq (Get-InstalledModule -Name PSRule -MinimumVersion 2.0.0 -ErrorAction Ignore)) {
Install-Module -Name PSRule -Repository PSGallery -MinimumVersion 2.0.0 -Scope CurrentUser -Force;
if ($Null -eq (Get-InstalledModule -Name PSRule -MinimumVersion 2.9.0 -ErrorAction Ignore)) {
Install-Module -Name PSRule -Repository PSGallery -MinimumVersion 2.9.0 -Scope CurrentUser -Force;
}
Import-Module -Name PSRule -Verbose:$False;
}
@ -201,17 +201,10 @@ task ReleaseExtension {
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 Install Build, InstallExtension
task . Build
task Release VersionExtension, ReleaseExtension, TagBuild
task Release VersionExtension, ReleaseExtension

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

@ -47,11 +47,21 @@ export interface ISetting {
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;
/**
* Set `Execution.RuleSuppressed`.
* See help: https://microsoft.github.io/PSRule/v3/concepts/PSRule/en-US/about_PSRule_Options/#executionrulesuppressed
*/
executionRuleSuppressed: ExecutionActionPreference;
/**
* Set `Execution.UnprocessedObject`.
* See help: https://microsoft.github.io/PSRule/v3/concepts/PSRule/en-US/about_PSRule_Options/#executionunprocessedobject
*/
executionUnprocessedObject: ExecutionActionPreference;
/**
@ -77,7 +87,6 @@ const globalDefaults: ISetting = {
documentationSnippet: 'Rule Doc',
documentationPath: undefined,
documentationLocalePath: env.language,
executionNotProcessedWarning: undefined,
executionRuleExcluded: ExecutionActionPreference.None,
executionRuleSuppressed: ExecutionActionPreference.None,
executionUnprocessedObject: ExecutionActionPreference.None,
@ -161,7 +170,6 @@ export class ConfigurationManager {
this.default.codeLensRuleDocumentationLinks
);
this.current.executionNotProcessedWarning = config.get<boolean>('execution.notProcessedWarning');
this.current.executionRuleExcluded = config.get<ExecutionActionPreference>('execution.ruleExcluded', this.default.executionRuleExcluded);
this.current.executionRuleSuppressed = config.get<ExecutionActionPreference>('execution.ruleSuppressed', this.default.executionRuleSuppressed);
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';
// Get channel
let extensionId = 'bewhite.psrule-vscode';
let extensionId = 'ps-rule.vscode';
let extensionChannel = 'stable';
const isStableInstalled = vscode.extensions.getExtension(extensionId) !== undefined;
if (path.basename(context.globalStorageUri.fsPath) === 'bewhite.psrule-vscode-preview') {
extensionId = 'bewhite.psrule-vscode-preview';
if (path.basename(context.globalStorageUri.fsPath) === 'ps-rule.vscode-preview') {
extensionId = 'ps-rule.vscode-preview';
extensionChannel = 'preview';
}
if (path.basename(context.globalStorageUri.fsPath) === 'bewhite.psrule-vscode-dev') {
extensionId = 'bewhite.psrule-vscode-dev';
if (path.basename(context.globalStorageUri.fsPath) === 'ps-rule.vscode-dev') {
extensionId = 'ps-rule.vscode-dev';
extensionChannel = 'dev';
}
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 executionRuleSuppressed = configuration.get().executionRuleSuppressed;
const executionUnprocessedObject = configuration.get().executionUnprocessedObject;
@ -303,12 +302,6 @@ export class PSRuleTaskProvider implements vscode.TaskProvider {
PSRULE_OUTPUT_BANNER: 'Minimal',
};
if (executionNotProcessedWarning !== undefined) {
taskEnv.PSRULE_EXECUTION_NOTPROCESSEDWARNING = executionNotProcessedWarning
? 'true'
: 'false';
}
if (executionRuleExcluded !== undefined && executionRuleExcluded !== ExecutionActionPreference.None) {
taskEnv.PSRULE_EXECUTION_RULEEXCLUDED = executionRuleExcluded;
}

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

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

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

@ -10,7 +10,7 @@ suite('Extension tests', () => {
.then((info) => {
assert.strictEqual('dev', info.channel);
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) => {
assert.fail(`Failed to get extension info. ${reason}`);