Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self):
with open(self.filename, 'r') as f:
data = json.load(f)
self.rules = data.get('rules', [])
validate_rule_patterns(self.rules)
default_rules_config = data.get('rules_config', {})
self.include_paths = data.get('include_paths', [u'.'])
self.paths = {
abspath(path): PathConfig(self, default_rules_config, config)
for (path, config) in data.get('paths', {}).items()
}
self.base_config = PathConfig(self, default_rules_config, {})
def __init__(self):
with open(self.filename, 'r') as f:
data = json.load(f)
self.rules = data.get('rules', [])
validate_rule_patterns(self.rules)
default_rules_config = data.get('rules_config', {})
self.include_paths = data.get('include_paths', [u'.'])
self.paths = {
abspath(path): PathConfig(self, default_rules_config, config)
for (path, config) in data.get('paths', {}).items()
}
self.base_config = PathConfig(self, default_rules_config, {})