| Tim Windelschmidt | a068440 | 2025-02-25 11:32:40 +0100 | [diff] [blame^] | 1 | # Flattens the previously generated entries together |
| 2 | def build_nogo_config(v): |
| 3 | out = {} |
| 4 | for exp in v: |
| 5 | for check, cfg in exp.items(): |
| 6 | if check not in out: |
| 7 | out[check] = {} |
| 8 | |
| 9 | for k, v in cfg.items(): |
| 10 | if k not in out[check]: |
| 11 | out[check][k] = {} |
| 12 | |
| 13 | out[check][k] = out[check][k] | v |
| 14 | |
| 15 | return out |
| 16 | |
| 17 | def exclude_from_checks(path, *checks): |
| 18 | return { |
| 19 | check: { |
| 20 | "exclude_files": { |
| 21 | "external/.+%s/" % path: "", |
| 22 | }, |
| 23 | } |
| 24 | for check in checks |
| 25 | } |
| 26 | |
| 27 | def exclude_from_external(checks): |
| 28 | return { |
| 29 | check: { |
| 30 | "exclude_files": { |
| 31 | # Don't run linters on external dependencies |
| 32 | "external/": "third_party", |
| 33 | "bazel-out/": "generated_output", |
| 34 | "cgo/": "cgo", |
| 35 | }, |
| 36 | } |
| 37 | for check in checks |
| 38 | } |