Mercurial > kallithea
comparison scripts/deps.py @ 8816:c76638100ca0
deps: also report unseen known violations
author | Mads Kiilerich <mads@kiilerich.com> |
---|---|
date | Tue, 29 Dec 2020 22:30:48 +0100 |
parents | 4a18e6bf6b87 |
children | 1f92cded1bd2 |
comparison
equal
deleted
inserted
replaced
8815:1b683a4eb9fc | 8816:c76638100ca0 |
---|---|
151 '''.split()) | 151 '''.split()) |
152 | 152 |
153 shown_modules = normal_modules | top_modules | 153 shown_modules = normal_modules | top_modules |
154 | 154 |
155 # break the chains somehow - this is a cleanup TODO list | 155 # break the chains somehow - this is a cleanup TODO list |
156 known_violations = [ | 156 known_violations = set([ |
157 ('kallithea.lib.auth_modules', 'kallithea.lib.auth'), # needs base&facade | 157 ('kallithea.lib.auth_modules', 'kallithea.lib.auth'), # needs base&facade |
158 ('kallithea.lib.utils', 'kallithea.model'), # clean up utils | 158 ('kallithea.lib.utils', 'kallithea.model'), # clean up utils |
159 ('kallithea.lib.utils', 'kallithea.model.db'), | 159 ('kallithea.lib.utils', 'kallithea.model.db'), |
160 ('kallithea.lib.utils', 'kallithea.model.scm'), | 160 ('kallithea.lib.utils', 'kallithea.model.scm'), |
161 ('kallithea.model.async_tasks', 'kallithea.lib.hooks'), | 161 ('kallithea.model.async_tasks', 'kallithea.lib.hooks'), |
164 ('kallithea.model', 'kallithea.lib.auth'), # auth.HasXXX | 164 ('kallithea.model', 'kallithea.lib.auth'), # auth.HasXXX |
165 ('kallithea.model', 'kallithea.lib.auth_modules'), # validators | 165 ('kallithea.model', 'kallithea.lib.auth_modules'), # validators |
166 ('kallithea.model', 'kallithea.lib.hooks'), # clean up hooks | 166 ('kallithea.model', 'kallithea.lib.hooks'), # clean up hooks |
167 ('kallithea.model', 'kallithea.model.scm'), | 167 ('kallithea.model', 'kallithea.model.scm'), |
168 ('kallithea.model.scm', 'kallithea.lib.hooks'), | 168 ('kallithea.model.scm', 'kallithea.lib.hooks'), |
169 ] | 169 ]) |
170 | 170 |
171 extra_edges = [ | 171 extra_edges = [ |
172 ('kallithea.config', 'kallithea.controllers'), # through TG | 172 ('kallithea.config', 'kallithea.controllers'), # through TG |
173 ('kallithea.lib.auth', 'kallithea.lib.auth_modules'), # custom loader | 173 ('kallithea.lib.auth', 'kallithea.lib.auth_modules'), # custom loader |
174 ] | 174 ] |
269 f.write(' "%s" -> "%s"%s\n' % (a, b, ' [color=red]' if (a, b) in known_violations else ' [color=green]' if (a, b) in extra_edges else '')) | 269 f.write(' "%s" -> "%s"%s\n' % (a, b, ' [color=red]' if (a, b) in known_violations else ' [color=green]' if (a, b) in extra_edges else '')) |
270 f.write('}\n') | 270 f.write('}\n') |
271 | 271 |
272 # verify dependencies by untangling dependency chain bottom-up: | 272 # verify dependencies by untangling dependency chain bottom-up: |
273 todo = set(normalized_dep_edges) | 273 todo = set(normalized_dep_edges) |
274 unseen_violations = known_violations.difference(todo) | |
275 assert not unseen_violations, unseen_violations | |
274 for x in known_violations: | 276 for x in known_violations: |
275 todo.remove(x) | 277 todo.remove(x) |
276 | 278 |
277 while todo: | 279 while todo: |
278 depending = set(a for a, b in todo) | 280 depending = set(a for a, b in todo) |