fix: use rules when alwaysApply is absent
This commit is contained in:
parent
13c1b0c5c0
commit
fde7eae70a
2 changed files with 3 additions and 3 deletions
|
|
@ -132,7 +132,7 @@ const isFileInDirectory = (
|
|||
* Checks if a rule is a root-level rule (.continue directory or no file path)
|
||||
*/
|
||||
const isRootLevelRule = (rule: RuleWithSource): boolean => {
|
||||
return !rule.ruleFile || rule.ruleFile.startsWith(".continue/");
|
||||
return !rule.ruleFile || rule.ruleFile.includes(".continue/"); // ruleFile path is absolute - hence we need to check for it in between
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ describe("Rule colocation glob matching", () => {
|
|||
name: "Root Rule",
|
||||
rule: "Follow project standards",
|
||||
source: "rules-block",
|
||||
ruleFile: ".continue/rules.md",
|
||||
ruleFile: "/path/to/repo/.continue/rules.md",
|
||||
// No restriction, should apply to all files
|
||||
};
|
||||
|
||||
|
|
@ -212,7 +212,7 @@ describe("Rule policies", () => {
|
|||
name: "Root Rule",
|
||||
rule: "Follow project standards",
|
||||
source: "rules-block",
|
||||
ruleFile: ".continue/rules.md",
|
||||
ruleFile: "/my/project/.continue/rules.md",
|
||||
};
|
||||
|
||||
// Off policy should override even global rules
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue