* Implementation of abstract method from FeatureProcessor * Load tool-specific ignore configurations and parse them into ToolIgnore instances
({
forDeletion = false,
}: {
forDeletion?: boolean;
} = {})
| 143 | * Load tool-specific ignore configurations and parse them into ToolIgnore instances |
| 144 | */ |
| 145 | async loadToolFiles({ |
| 146 | forDeletion = false, |
| 147 | }: { |
| 148 | forDeletion?: boolean; |
| 149 | } = {}): Promise<ToolFile[]> { |
| 150 | try { |
| 151 | const factory = this.getFactory(this.toolTarget); |
| 152 | const paths = factory.class.getSettablePaths({ options: this.featureOptions }); |
| 153 | |
| 154 | if (forDeletion) { |
| 155 | const toolIgnore = factory.class.forDeletion({ |
| 156 | outputRoot: this.outputRoot, |
| 157 | relativeDirPath: paths.relativeDirPath, |
| 158 | relativeFilePath: paths.relativeFilePath, |
| 159 | }); |
| 160 | |
| 161 | const toolIgnores = toolIgnore.isDeletable() ? [toolIgnore] : []; |
| 162 | return toolIgnores; |
| 163 | } |
| 164 | |
| 165 | const toolIgnores = await this.loadToolIgnores(); |
| 166 | return toolIgnores; |
| 167 | } catch (error) { |
| 168 | const errorMessage = `Failed to load tool files for ${this.toolTarget}: ${formatError(error)}`; |
| 169 | if (error instanceof Error && error.message.includes("no such file or directory")) { |
| 170 | this.logger.debug(errorMessage); |
| 171 | } else { |
| 172 | this.logger.error(errorMessage); |
| 173 | } |
| 174 | return []; |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | async loadToolIgnores(): Promise<ToolIgnore[]> { |
| 179 | const factory = this.getFactory(this.toolTarget); |
no test coverage detected