Return a mapping of {error message: [list of Rule]} from validating a list of ``rules`` Rule integrity and correctness using known licenses from a mapping of ``licenses_by_key`` {key: License}`.
(rules, licenses_by_key, thorough=False)
| 1081 | |
| 1082 | |
| 1083 | def _validate_all_rules(rules, licenses_by_key, thorough=False): |
| 1084 | """ |
| 1085 | Return a mapping of {error message: [list of Rule]} from validating a list |
| 1086 | of ``rules`` Rule integrity and correctness using known licenses from a |
| 1087 | mapping of ``licenses_by_key`` {key: License}`. |
| 1088 | """ |
| 1089 | licensing = Licensing(symbols=licenses_by_key.values()) |
| 1090 | errors = defaultdict(list) |
| 1091 | |
| 1092 | for rule in rules: |
| 1093 | for err_msg in rule.validate(licensing, thorough=thorough): |
| 1094 | errors[err_msg].append(rule) |
| 1095 | return errors |
| 1096 | |
| 1097 | |
| 1098 | def validate_rules(rules, licenses_by_key, with_text=False, rules_data_dir=rules_data_dir, thorough=False): |
no test coverage detected