MCPcopy Create free account
hub / github.com/dyoshikawa/rulesync / loadToolFiles

Method loadToolFiles

src/features/ignore/ignore-processor.ts:145–176  ·  view source on GitHub ↗

* Implementation of abstract method from FeatureProcessor * Load tool-specific ignore configurations and parse them into ToolIgnore instances

({
    forDeletion = false,
  }: {
    forDeletion?: boolean;
  } = {})

Source from the content-addressed store, hash-verified

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);

Callers 2

importIgnoreCoreFunction · 0.95

Calls 8

loadToolIgnoresMethod · 0.95
formatErrorFunction · 0.85
getFactoryMethod · 0.45
getSettablePathsMethod · 0.45
forDeletionMethod · 0.45
isDeletableMethod · 0.45
debugMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected