From 14a8bf5f28bb6b07ebb6129949c099e2f70c7d70 Mon Sep 17 00:00:00 2001 From: kai ru <69238381+kairu-ms@users.noreply.github.com> Date: Wed, 11 Aug 2021 11:39:36 +0800 Subject: [PATCH 1/2] Disable History.rst overriding --- src/generate/generators/ExtensionFull.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)); From 1bf1b0ee0ac7e1bb33d40743f514120b26842aaa Mon Sep 17 00:00:00 2001 From: kai ru <69238381+kairu-ms@users.noreply.github.com> Date: Wed, 11 Aug 2021 12:39:08 +0800 Subject: [PATCH 2/2] add protection for history.rst and yaml file --- src/generate/azgenerator.ts | 6 ++++++ src/utils/models.ts | 1 + 2 files changed, 7 insertions(+) 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/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', );