303 lines
17 KiB
Plaintext
303 lines
17 KiB
Plaintext
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/fetch_sources.py:18:17
|
|
|
|
|
16 | target.parent.mkdir(parents=True, exist_ok=True)
|
|
17 | target.write_bytes(raw)
|
|
18 | rows.append(dict(id=f'{repo}@{commit}:{path}', commit=commit, raw_url=url,
|
|
| _________________^
|
|
19 | | local_file=local, sha256=hashlib.sha256(raw).hexdigest(),
|
|
20 | | retrieved_at=datetime.now(timezone.utc).isoformat(), license=license,
|
|
21 | | lines=[[1,len(raw.decode().splitlines())]]))
|
|
| |________________________________________________________________^
|
|
22 |
|
|
23 | for p in ['web/js/setgetnodes.js','web/js/utility.js','__init__.py','pyproject.toml','LICENSE']:
|
|
|
|
|
help: Rewrite as a literal
|
|
|
|
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/recompute.py:55:38
|
|
|
|
|
53 | six = audit.audit(repo, 'case04-batch-reference')
|
|
54 | assert six == json.loads((repo/'docs/hel-892/media-evidence/protected-six-cases.json').read_bytes())
|
|
55 | write('previous-protection.json',dict(baseline_profiles=profiles,old_attempts_identical=True,
|
|
| ______________________________________^
|
|
56 | | old_gaps_identical=True,six_companion_differences_identical=True,old_candidate_hashes_identical=True))
|
|
| |_____________________________________________________________________________________________________________^
|
|
57 |
|
|
58 | def groups(report):
|
|
|
|
|
help: Rewrite as a literal
|
|
|
|
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/recompute.py:65:16
|
|
|
|
|
63 | def stats(report):
|
|
64 | gs = groups(report)
|
|
65 | return dict(groups=len(gs),raw_occurrences=sum(sum(c.values()) for c in gs.values()),
|
|
| ________________^
|
|
66 | | unique_occurrences_per_group=sum(len(c) for c in gs.values()),
|
|
67 | | unique_nodes=len({o for c in gs.values() for o in c}),
|
|
68 | | unique_paths=len({o[0] for c in gs.values() for o in c}))
|
|
| |_____________________________________________________________________________^
|
|
69 |
|
|
70 | def diffrows(a,b):
|
|
|
|
|
help: Rewrite as a literal
|
|
|
|
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/recompute.py:71:17
|
|
|
|
|
70 | def diffrows(a,b):
|
|
71 | return [dict(key=list(k), occurrences=[dict(source_path=o[0],node_pointer=o[1],node_id=o[2],count=n)
|
|
| _________________^
|
|
72 | | for o,n in sorted((v-b.get(k,Counter())).items(),key=str)])
|
|
| |___________________________________________________________________________^
|
|
73 | for k,v in sorted(a.items(),key=str) if v-b.get(k,Counter())]
|
|
|
|
|
help: Rewrite as a literal
|
|
|
|
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/recompute.py:71:48
|
|
|
|
|
70 | def diffrows(a,b):
|
|
71 | return [dict(key=list(k), occurrences=[dict(source_path=o[0],node_pointer=o[1],node_id=o[2],count=n)
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
72 | for o,n in sorted((v-b.get(k,Counter())).items(),key=str)])
|
|
73 | for k,v in sorted(a.items(),key=str) if v-b.get(k,Counter())]
|
|
|
|
|
help: Rewrite as a literal
|
|
|
|
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/recompute.py:81:33
|
|
|
|
|
79 | ga,gb = groups(before),groups(now)
|
|
80 | added,removed = diffrows(gb,ga),diffrows(ga,gb)
|
|
81 | write('coverage-delta.json',dict(baseline_profiles=profiles,baseline=stats(before),current=stats(now),
|
|
| _________________________________^
|
|
82 | | key_fields=['type','provider','version','profile','code','rule_gap'],
|
|
83 | | occurrence_key=['source_path','node_pointer','node_id'],
|
|
84 | | added_groups=added,removed_groups=removed,
|
|
85 | | added_occurrences=sum(o['count'] for g in added for o in g['occurrences']),
|
|
86 | | removed_occurrences=sum(o['count'] for g in removed for o in g['occurrences']),
|
|
87 | | new_complete_paths=now['coverage_delta']['new_complete_paths'],
|
|
88 | | complete_paths=now['coverage_delta']['current_complete_paths'],
|
|
89 | | closed_paths=[r['source_path'] for r in now['cases'] if r['status']=='blocked'],
|
|
90 | | unavailable_frontend_paths_unchanged=unavailable(now),
|
|
91 | | attempt_counts=dict(Counter(a['status'] for r in now['cases'] for a in r['attempts'])),
|
|
92 | | conflicts=sum(r['status']=='candidate_conflict' for r in now['cases'])))
|
|
| |_______________________________________________________________________________^
|
|
93 |
|
|
94 | # Read every manifest path, including non-.json suffixes and unused subgraphs.
|
|
|
|
|
help: Rewrite as a literal
|
|
|
|
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/recompute.py:104:30
|
|
|
|
|
102 | for k in n['pointer'].split('/')[1:]:
|
|
103 | node=node[int(k)] if isinstance(node,list) else node[k]
|
|
104 | inventory.append(dict(source_path=row['source_path'],source_sha256=row['source_sha256'],
|
|
| ______________________________^
|
|
105 | | node_pointer=n['pointer'],node_id=n['node_id'],type=n['type'],mode=node.get('mode',0),
|
|
106 | | scope='root' if n['pointer'].startswith('/nodes/') else 'definition',
|
|
107 | | properties=node.get('properties'),widgets_values=node.get('widgets_values'),
|
|
108 | | frontend=row['frontend_version']))
|
|
| |_________________________________________________^
|
|
109 | write('inventory.json',inventory)
|
|
110 | old_gaps=[g for g in old['gap_groups'] if g['type'] in ('SetNode','GetNode')]
|
|
|
|
|
help: Rewrite as a literal
|
|
|
|
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/recompute.py:112:36
|
|
|
|
|
110 | old_gaps=[g for g in old['gap_groups'] if g['type'] in ('SetNode','GetNode')]
|
|
111 | occurrences=Counter((o['source_path'],o['node_pointer'],o['node_id']) for g in old_gaps for o in g['occurrences'])
|
|
112 | write('inventory-summary.json',dict(
|
|
| ____________________________________^
|
|
113 | | target_scope='145 UI after case06 exclusion; includes unused definitions',
|
|
114 | | nodes=len(inventory),paths=len({n['source_path'] for n in inventory}),
|
|
115 | | types=dict(Counter(n['type'] for n in inventory)),
|
|
116 | | scopes=dict(Counter(n['scope'] for n in inventory)),
|
|
117 | | declarations=dict(Counter(json.dumps({k:(n['properties'] or {}).get(k) for k in ('cnr_id','aux_id','ver')},sort_keys=True) for n…
|
|
118 | | modes=dict(Counter(str(n['mode']) for n in inventory)),
|
|
119 | | old_gap_groups=len(old_gaps),old_gap_raw=sum(occurrences.values()),
|
|
120 | | old_gap_unique_nodes=len(occurrences),old_gap_paths=len({o[0] for o in occurrences}),
|
|
121 | | old_gap_occurrences=[dict(source_path=k[0],node_pointer=k[1],node_id=k[2],count=v) for k,v in sorted(occurrences.items())]))
|
|
| |___________________________________________________________________________________________________________________________________^
|
|
122 |
|
|
123 | # Diagnostic raw trace for the TWO previously scoped Scail Combine nodes.
|
|
|
|
|
help: Rewrite as a literal
|
|
|
|
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/recompute.py:121:30
|
|
|
|
|
119 | old_gap_groups=len(old_gaps),old_gap_raw=sum(occurrences.values()),
|
|
120 | old_gap_unique_nodes=len(occurrences),old_gap_paths=len({o[0] for o in occurrences}),
|
|
121 | old_gap_occurrences=[dict(source_path=k[0],node_pointer=k[1],node_id=k[2],count=v) for k,v in sorted(occurrences.items())]))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
122 |
|
|
123 | # Diagnostic raw trace for the TWO previously scoped Scail Combine nodes.
|
|
|
|
|
help: Rewrite as a literal
|
|
|
|
RUF059 Unpacked variable `bi` is never used
|
|
--> docs/hel-892/setget-evidence/recompute.py:141:34
|
|
|
|
|
139 | while True:
|
|
140 | li,e=links[lid]
|
|
141 | ai,a=nodes[e[1]];bi,b=nodes[e[3]]
|
|
| ^^
|
|
142 | assert b['inputs'][e[4]]['link']==lid
|
|
143 | assert (a['outputs'][e[2]].get('links') or []).count(lid)==1
|
|
|
|
|
help: Prefix it with an underscore or any other dummy variable pattern
|
|
|
|
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/recompute.py:147:21
|
|
|
|
|
145 | assert a['id'] not in seen
|
|
146 | seen.add(a['id'])
|
|
147 | hop=dict(original_link=e,link_pointer=f'/links/{li}',node_pointer=f'/nodes/{ai}',
|
|
| _____________________^
|
|
148 | | node_id=a['id'],type=a['type'],output_slot=e[2],output_pointer=f'/nodes/{ai}/outputs/{e[2]}',
|
|
149 | | mode=a.get('mode',0),properties=a.get('properties'))
|
|
| |________________________________________________________________________^
|
|
150 | hops.append(hop)
|
|
151 | if a['type']=='GetNode':
|
|
|
|
|
help: Rewrite as a literal
|
|
|
|
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/recompute.py:159:33
|
|
|
|
|
157 | hop.update(name=name,name_pointer=f'/nodes/{ai}/widgets_values/0',
|
|
158 | raw_root_unique_set=setter['id'])
|
|
159 | hops.append(dict(node_id=setter['id'],type='SetNode',node_pointer=f'/nodes/{si}',
|
|
| _________________________________^
|
|
160 | | current_name=setter['widgets_values'][0],name_pointer=f'/nodes/{si}/widgets_values/0',
|
|
161 | | previousName=(setter.get('properties') or {}).get('previousName'),
|
|
162 | | mode=setter.get('mode',0),properties=setter.get('properties'),input_slot=0,
|
|
163 | | input_pointer=f'/nodes/{si}/inputs/0'))
|
|
| |______________________________________________________________^
|
|
164 | lid=setter['inputs'][0]['link']
|
|
165 | elif a['type'] in ('SetNode','Reroute'):
|
|
|
|
|
help: Rewrite as a literal
|
|
|
|
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/recompute.py:171:27
|
|
|
|
|
169 | result=project_reference_setget(source)
|
|
170 | assert result.graph is None
|
|
171 | chains.append(dict(source_path=row['source_path'],source_sha256=row['source_sha256'],
|
|
| ___________________________^
|
|
172 | | combine_id=n['id'],saved_frame_rate=n['widgets_values']['frame_rate'],
|
|
173 | | saved_value_pointer=f'/nodes/{ni}/widgets_values/frame_rate',
|
|
174 | | target_pointer=f'/nodes/{ni}/inputs/{slot}',hops=hops,
|
|
175 | | endpoint=[str(a['id']),e[2]],endpoint_type=a['outputs'][e[2]]['type'],
|
|
176 | | final_scalar='unknown; upstream VHS_VideoInfoLoaded has no selected node contract; no media probe',
|
|
177 | | authority='literal_root_topology_only_not_trusted_binding_or_partial_prompt',
|
|
178 | | whole_graph_rejections=result.issues,comparison_status=row['comparison_status']))
|
|
| |________________________________________________________________________________________________^
|
|
179 | assert len(chains)==2
|
|
180 | write('scail-frame-rate.json',chains)
|
|
|
|
|
help: Rewrite as a literal
|
|
|
|
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/recompute.py:193:23
|
|
|
|
|
191 | for lo,hi in entry.get('rule_locations',{}).values():
|
|
192 | assert 1<=lo<=hi<=len(lines)
|
|
193 | counts.append(dict(manifest=name,entries=len(rows),unique_ids=len({r['id'] for r in rows})))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
194 | entries.extend(rows)
|
|
195 | write('cached-sources-check.json',dict(manifests=counts,entries=len(entries),
|
|
|
|
|
help: Rewrite as a literal
|
|
|
|
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/recompute.py:195:39
|
|
|
|
|
193 | counts.append(dict(manifest=name,entries=len(rows),unique_ids=len({r['id'] for r in rows})))
|
|
194 | entries.extend(rows)
|
|
195 | write('cached-sources-check.json',dict(manifests=counts,entries=len(entries),
|
|
| _______________________________________^
|
|
196 | | unique_ids_summed_per_manifest=sum(c['unique_ids'] for c in counts),
|
|
197 | | global_distinct_id_strings=len({r['id'] for r in entries}),
|
|
198 | | unique_url_and_hash=len({(r['raw_url'],r['sha256']) for r in entries}),
|
|
199 | | note='ID counts are strings; URL+SHA256 is separately deduplicated; repeated frontend originals retained'))
|
|
| |__________________________________________________________________________________________________________________^
|
|
200 |
|
|
201 | originals=json.loads((repo/'docs/hel-892/media-evidence/original-bytes.json').read_bytes())['files']
|
|
|
|
|
help: Rewrite as a literal
|
|
|
|
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/recompute.py:206:33
|
|
|
|
|
204 | assert raw==subprocess.check_output(['git','show',f"{BASE}:{row['path']}"],cwd=repo)
|
|
205 | assert len(originals)==163
|
|
206 | write('original-bytes.json',dict(base=BASE,count=163,all_unchanged=True,files=originals))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
207 | production=json.loads((repo/'docs/hel-892/vhs-evidence/production-protection.json').read_bytes())['files']
|
|
208 | for row in production:
|
|
|
|
|
help: Rewrite as a literal
|
|
|
|
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/recompute.py:212:40
|
|
|
|
|
210 | assert raw==subprocess.check_output(['git','show',f"{BASE}:{row['path']}"],cwd=repo)
|
|
211 | assert hashlib.sha256(raw).hexdigest()==row['sha256']
|
|
212 | write('production-protection.json',dict(base=BASE,files=production))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
213 | db=sqlite3.connect(args.db);db.row_factory=sqlite3.Row
|
|
214 | rows=db.execute('SELECT * FROM workflows WHERE source_repo_path IS NOT NULL').fetchall()
|
|
|
|
|
help: Rewrite as a literal
|
|
|
|
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/recompute.py:220:28
|
|
|
|
|
218 | companion_values=sum(p.get('value_origin')=='supplied_api_companion' for r in rows for p in json.loads(r['doc_json'])['params'])
|
|
219 | assert companion_values==294 and issues['companion_unverified']==6 and issues['environment_unchecked']==16
|
|
220 | write('isolation.json',dict(states=dict(Counter(r['import_state'] for r in rows)),count=155,
|
|
| ____________________________^
|
|
221 | | enabled_or_completed_or_executed=0,issue_counts=dict(issues),companion_named_values=companion_values,
|
|
222 | | reference_candidates_written_to_db=False,user_whole_row_protection='executed affected tests'))
|
|
| |_____________________________________________________________________________________________________^
|
|
223 | db.close()
|
|
224 | report=audit_docs(repo,args.documents.resolve())
|
|
|
|
|
help: Rewrite as a literal
|
|
|
|
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/recompute.py:236:29
|
|
|
|
|
234 | member=next(n for n in sd.getnames() if n.endswith(f'/src/calliope/comfyui/{name}'))
|
|
235 | assert sd.extractfile(member).read()==raw
|
|
236 | packages.append(dict(path=p,sha256=hashlib.sha256(raw).hexdigest(),wheel_matches=True,sdist_matches=True))
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
237 | write('package-check.json',packages)
|
|
238 | print(json.dumps(dict(ui=now['ui_total'],attempts=Counter(a['status'] for r in now['cases'] for a in r['attempts']),
|
|
|
|
|
help: Rewrite as a literal
|
|
|
|
C408 Unnecessary `dict()` call (rewrite as a literal)
|
|
--> docs/hel-892/setget-evidence/recompute.py:238:22
|
|
|
|
|
236 | packages.append(dict(path=p,sha256=hashlib.sha256(raw).hexdigest(),wheel_matches=True,sdist_matches=True))
|
|
237 | write('package-check.json',packages)
|
|
238 | print(json.dumps(dict(ui=now['ui_total'],attempts=Counter(a['status'] for r in now['cases'] for a in r['attempts']),
|
|
| ______________________^
|
|
239 | | complete=len(now['coverage_delta']['current_complete_paths']),new_complete=now['coverage_delta']['new_complete_paths'],
|
|
240 | | inventory_nodes=len(inventory),inventory_paths=len({n['source_path'] for n in inventory}),gap_stats=stats(now)),ensure_asci…
|
|
| |_______________________________________________________________________________________________________________________^
|
|
help: Rewrite as a literal
|
|
|
|
Found 24 errors (4 fixed, 20 remaining).
|
|
No fixes available (20 hidden fixes can be enabled with the `--unsafe-fixes` option).
|