MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / from_file

Method from_file

src/licensedcode/models.py:2272–2279  ·  view source on GitHub ↗

Return a new Rule object loaded from a file stored at ``rule_file`` with the text and it's data as with YAML frontmatter.

(cls, rule_file, is_builtin=True)

Source from the content-addressed store, hash-verified

2270
2271 @classmethod
2272 def from_file(cls, rule_file, is_builtin=True):
2273 """
2274 Return a new Rule object loaded from a file stored at
2275 ``rule_file`` with the text and it's data as with YAML frontmatter.
2276 """
2277 rule = Rule(is_builtin=is_builtin)
2278 rule.load_data(rule_file=rule_file)
2279 return rule
2280
2281 @property
2282 def pysafe_expression(self):

Callers 1

load_rulesFunction · 0.45

Calls 2

load_dataMethod · 0.95
RuleClass · 0.85

Tested by

no test coverage detected