fix(rules-core): fall back to workspace directory when no project root marker is found
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -339,6 +339,7 @@ describe("createRuleInjectionProcessor", () => {
|
||||
contentHashes: new Set<string>(),
|
||||
realPaths: new Set<string>([ruleRealPath]),
|
||||
}),
|
||||
homedir: () => homeRoot,
|
||||
});
|
||||
|
||||
// when
|
||||
|
||||
@@ -137,6 +137,9 @@ export function createRuleInjectionProcessor(deps: {
|
||||
} = deps;
|
||||
|
||||
const matchDecisionCache: MatchDecisionCache = new Map();
|
||||
const finderOptions: FindRuleFilesOptions = ruleFinderOptions
|
||||
? { ...ruleFinderOptions, workspaceDirectory }
|
||||
: { workspaceDirectory };
|
||||
|
||||
function getParsedRule(filePath: string, realPath: string): ParsedRule {
|
||||
try {
|
||||
@@ -189,7 +192,7 @@ export function createRuleInjectionProcessor(deps: {
|
||||
projectRoot,
|
||||
home,
|
||||
resolved,
|
||||
ruleFinderOptions,
|
||||
finderOptions,
|
||||
ruleScanCache,
|
||||
);
|
||||
const toInject: RuleToInject[] = [];
|
||||
|
||||
Reference in New Issue
Block a user