Skip to content

Loading rules

Souji edited this page Dec 25, 2023 · 5 revisions

Local Rules

The loadRulesInto(path: string, cache: RuleCache) method recursively reads a folder structure from the provided path, trying to parse all .yml files as rules. Parsed rules are then loaded into the provided cache. This allows you to easily load rules from multiple sources into the same cache.

Note

RuleCache is a convenience type and just a Map<string, Rule>.

Rule Repositories

The loadRuleRepositoryInto(owner: string, repository: string, path: string, cache: RuleCache) method recursively reads a folder in the configured git repository starting at the provided path (use "" if you want to read the entire repository). Parsed rules are loaded into the provided cache. A rule repository is just a GitHub repository including Omega rules.

Note

RuleCache is a convenience type and just a Map<string, Rule>.

Important

At the moment rule repositories have to be public to use this method. For private repositories, you will have to implement custom loading logic.

Clone this wiki locally