-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: folderConfigs LS integration wip
- Loading branch information
Showing
8 changed files
with
87 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { FolderConfig, IConfiguration } from './configuration'; | ||
|
||
export interface IFolderConfigs { | ||
getFolderConfigs(config: IConfiguration): ReadonlyArray<FolderConfig>; | ||
|
||
resetFolderConfigsCache(): void; | ||
} | ||
|
||
export class FolderConfigs implements IFolderConfigs { | ||
private folderConfigsCache?: ReadonlyArray<FolderConfig>; | ||
|
||
getFolderConfigs(config: IConfiguration): ReadonlyArray<FolderConfig> { | ||
if (this.folderConfigsCache !== undefined) { | ||
return this.folderConfigsCache; | ||
} | ||
|
||
const folderConfigs = config.getFolderConfigs(); | ||
|
||
this.folderConfigsCache = folderConfigs; | ||
|
||
return folderConfigs; | ||
} | ||
|
||
setFolderConfig(_config: IConfiguration, _folderPath: string, _baseBranch: string) { | ||
// Get all folders and update one you need and use setFolderConfig. | ||
// if (this.folderConfigsCache !== undefined) { | ||
// return this.folderConfigsCache; | ||
// } | ||
|
||
Check failure on line 29 in src/snyk/common/configuration/folderConfig.ts GitHub Actions / Build and Test (ubuntu-latest)
|
||
// const folderConfigs = config.getFolderConfigs(); | ||
|
||
Check failure on line 31 in src/snyk/common/configuration/folderConfig.ts GitHub Actions / Build and Test (ubuntu-latest)
|
||
// this.folderConfigsCache = folderConfigs; | ||
|
||
// return folderConfigs; | ||
} | ||
|
||
resetFolderConfigsCache() { | ||
this.folderConfigsCache = undefined; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters