From 130ea455535289adb9a6694543b0a5372b3a4cdb Mon Sep 17 00:00:00 2001 From: kai ru <69238381+kairu-ms@users.noreply.github.com> Date: Wed, 11 Aug 2021 16:20:55 +0800 Subject: [PATCH] Disable History.rst overriding (#877) * Disable History.rst overriding * add protection for history.rst and yaml file --- src/generate/azgenerator.ts | 6 ++++++ src/generate/generators/ExtensionFull.ts | 2 +- src/utils/models.ts | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/generate/azgenerator.ts b/src/generate/azgenerator.ts index 1e127662..10e8fe5e 100644 --- a/src/generate/azgenerator.ts +++ b/src/generate/azgenerator.ts @@ -30,9 +30,15 @@ export async function processRequest(host: Host) { PathConstants.recordingFolder, ), ); + session.protectFiles( + path.join(configHandler.azOutputFolder, PathConstants.historyRstFile), + ); session.protectFiles( path.join(configHandler.azOutputFolder, PathConstants.readmeFile), ); + session.protectFiles( + path.join(configHandler.azOutputFolder, PathConstants.linterExclusionsFile), + ); } while (model.SelectNextExtension()); } diff --git a/src/generate/generators/ExtensionFull.ts b/src/generate/generators/ExtensionFull.ts index 2d791ef7..5022861a 100644 --- a/src/generate/generators/ExtensionFull.ts +++ b/src/generate/generators/ExtensionFull.ts @@ -85,7 +85,7 @@ export class AzExtensionFullGenerator extends GeneratorBase { await this.generateFullSingleAndAddtoOutput(new CliTopHelp(this.model)); await this.generateFullSingleAndAddtoOutput(new CliTopMetadata(this.model)); await this.generateFullSingleAndAddtoOutput(new CliReport(this.model)); - await this.generateFullSingleAndAddtoOutput(new CliExtHistory(this.model)); + await this.generateFullSingleAndAddtoOutput(new CliExtHistory(this.model), false); await this.generateFullSingleAndAddtoOutput(new CliExtReadme(this.model), false); await this.generateFullSingleAndAddtoOutput(new CliExtSetupCfg(this.model)); await this.generateFullSingleAndAddtoOutput(new CliExtSetupPy(this.model)); diff --git a/src/utils/models.ts b/src/utils/models.ts index ee6c774d..9f3455fa 100644 --- a/src/utils/models.ts +++ b/src/utils/models.ts @@ -75,6 +75,7 @@ export class PathConstants { public static readonly setupPyFile: string = 'setup.py'; public static readonly setupCfgFile: string = 'setup.cfg'; public static readonly historyRstFile: string = 'HISTORY.rst'; + public static readonly linterExclusionsFile: string = 'linter_exclusions.yml'; public static readonly docSourceJsonFile: string = path.join( '/doc/sphinx/azhelpgen/doc_source_map.json', );