Repository navigation
Expand file tree
/
Copy pathwarrants.bib
More file actions
6135 lines (5276 loc) · 341 KB
/
Copy pathwarrants.bib
File metadata and controls
6135 lines (5276 loc) · 341 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% warrants.bib — one claim PER TEST CASE in the pycodemod suite.
%
% The claim text is TRANSCRIBED from each test function's own docstring, whose flagged
% paragraphs already argue the defect the case prevents. Where a docstring is a bare
% one-liner the claim is correspondingly plain; that thinness is a fact about the case
% rather than something invented over.
%
% Keying convention: pycodemod-<section>-<test name minus its `test_` prefix, hyphenated,
% with leading articles dropped>. Each check runs that one test function.
@misc{pycodemod-core-double-dash-ends-flag-recognition,
section = {core},
title = {⚑⚑ `--literal -- --selftest` must NOT see `--selftest` as a flag: THE ORIGIN'S DEFECT},
claim = { `--literal -- --selftest` must NOT see `--selftest` as a flag: THE ORIGIN'S DEFECT.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_core.py -k test_double_dash_ends_flag_recognition},
}
@misc{pycodemod-core-without-double-dash-every-token-is-flag-side,
section = {core},
title = {With no `--`, the whole tail is flag-side and there are no operands after it},
claim = {With no `--`, the whole tail is flag-side and there are no operands after it.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_core.py -k test_without_double_dash_every_token_is_flag_side},
}
@misc{pycodemod-core-invalid-escape-is-found-and-an-unreadable-file-is-reported,
section = {core},
title = {⚑ The found escape and the unread files are returned TOGETHER: an empty `found` is a fact},
claim = { The found escape and the unread files are returned TOGETHER: an empty `found` is a
fact.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_core.py -k test_an_invalid_escape_is_found_and_an_unreadable_file_is_reported},
}
@misc{pycodemod-core-clean-file-yields-nothing-and-is-read,
section = {core},
title = {A file with valid escapes only is neither found nor unread},
claim = {A file with valid escapes only is neither found nor unread.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_core.py -k test_a_clean_file_yields_nothing_and_is_read},
}
@misc{pycodemod-core-escape-seq-names-the-sequence-or-a-question-mark,
section = {core},
title = {The escape is read out of the warning text; a text naming none reads "?"},
claim = {The escape is read out of the warning text; a text naming none reads "?".},
check = {cmd:.venv/bin/python3 -m pytest tests/test_core.py -k test_escape_seq_names_the_sequence_or_a_question_mark},
}
@misc{pycodemod-core-package-resolves-to-its-directory,
section = {core},
title = {⚑ A package is its DIRECTORY, not its `__init__.py`},
claim = { A package is its DIRECTORY, not its `__init__.py`.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_core.py -k test_a_package_resolves_to_its_directory},
}
@misc{pycodemod-core-plain-module-resolves-to-its-file,
section = {core},
title = {A single-file module resolves to its own source file},
claim = {A single-file module resolves to its own source file.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_core.py -k test_a_plain_module_resolves_to_its_file},
}
@misc{pycodemod-core-absent-or-sourceless-module-says-why,
section = {core},
title = {No such module, a malformed name and a built-in each return None WITH a reason},
claim = {No such module, a malformed name and a built-in each return None WITH a reason.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_core.py -k test_an_absent_or_sourceless_module_says_why},
}
@misc{pycodemod-core-roundtrip-reports-identity-and-each-failure,
section = {core},
title = {Identical source round-trips; unreadable and unparseable files say which they were},
claim = {Identical source round-trips; unreadable and unparseable files say which they were.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_core.py -k test_roundtrip_reports_identity_and_each_failure},
}
@misc{pycodemod-core-unknown-renders-as-a-word,
section = {core},
title = {The sentinel prints as UNKNOWN, never as data},
claim = {The sentinel prints as UNKNOWN, never as data.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_core.py -k test_unknown_renders_as_a_word},
}
@misc{pycodemod-core-value-of-a-constant,
section = {core},
title = {A constant expression returns its value, and its shape is "literal"},
claim = {A constant expression returns its value, and its shape is "literal".},
check = {cmd:.venv/bin/python3 -m pytest tests/test_core.py -k test_value_of_a_constant},
}
@misc{pycodemod-core-value-of-a-computed-expression-is-unknown,
section = {core},
title = {⚑ Anything that is not a scalar constant is UNKNOWN — including `-"abc"`, which parses},
claim = { Anything that is not a scalar constant is UNKNOWN — including `-"abc"`, which parses.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_core.py -k test_value_of_a_computed_expression_is_unknown},
}
@misc{pycodemod-core-src-of-collapses-whitespace-and-marks-truncation,
section = {core},
title = {⚑ The grouping key is bounded, and a clipped key says it was clipped},
claim = { The grouping key is bounded, and a clipped key says it was clipped.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_core.py -k test_src_of_collapses_whitespace_and_marks_truncation},
}
@misc{pycodemod-core-src-of-empty-text-is-unknown,
section = {core},
title = {A node that renders to no text is UNKNOWN, not an empty key},
claim = {A node that renders to no text is UNKNOWN, not an empty key.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_core.py -k test_src_of_empty_text_is_unknown},
}
@misc{pycodemod-core-corpus-yields-a-directory-itself,
section = {core},
title = {A directory is its own tree: yielded absolute, and left in place afterwards},
claim = {A directory is its own tree: yielded absolute, and left in place afterwards.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_core.py -k test_corpus_yields_a_directory_itself},
}
@misc{pycodemod-core-corpus-extracts-an-archive-safely-and-removes-it,
section = {core},
title = {⚑ `..` and absolute members are dropped; the temp tree is gone after the scope},
claim = { `..` and absolute members are dropped; the temp tree is gone after the scope.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_core.py -k test_corpus_extracts_an_archive_safely_and_removes_it},
}
@misc{pycodemod-core-corpus-removes-the-tree-on-the-error-path,
section = {core},
title = {The temp tree is removed when the body fails, too},
claim = {The temp tree is removed when the body fails, too.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_core.py -k test_corpus_removes_the_tree_on_the_error_path},
}
@misc{pycodemod-core-per-file-keeps-file-order-serially-and-pooled,
section = {core},
title = {Below and above the pool threshold, every row arrives in file order},
claim = {Below and above the pool threshold, every row arrives in file order.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_core.py -k test_per_file_keeps_file_order_serially_and_pooled},
}
@misc{pycodemod-commentary-mark-is-bounded-only-where-it-is-alphanumeric,
section = {commentary},
title = {⚑⚑ `NB` must not fire inside "UNBALANCED"; `⚑` must still fire with no word boundary},
claim = { `NB` must not fire inside "UNBALANCED"; `` must still fire with no word boundary.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_commentary.py -k test_a_mark_is_bounded_only_where_it_is_alphanumeric},
}
@misc{pycodemod-commentary-key-is-the-sentence-not-the-bytes,
section = {commentary},
title = {A re-indented, re-commented line keys to the same sentence},
claim = {A re-indented, re-commented line keys to the same sentence.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_commentary.py -k test_the_key_is_the_sentence_not_the_bytes},
}
@misc{pycodemod-commentary-census-counts-every-marked-line-and-reports-the-unread,
section = {commentary},
title = {⚑ Marked lines in comments, docstrings and printed strings all count; unread is named},
claim = { Marked lines in comments, docstrings and printed strings all count; unread is named.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_commentary.py -k test_the_census_counts_every_marked_line_and_reports_the_unread},
}
@misc{pycodemod-commentary-census-honours-a-widened-mark-set,
section = {commentary},
title = {A caller's marks replace the default; the default alone does not see them},
claim = {A caller's marks replace the default; the default alone does not see them.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_commentary.py -k test_the_census_honours_a_widened_mark_set},
}
@misc{pycodemod-commentary-kinds-file-each-mark-where-it-lives,
section = {commentary},
title = {⚑⚑ Docstrings of module, class and def are documentation; an if-body string is payload},
claim = { Docstrings of module, class and def are documentation; an if-body string is payload.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_commentary.py -k test_kinds_file_each_mark_where_it_lives},
}
@misc{pycodemod-commentary-kinds-file-an-untokenizable-source-as-unparsed,
section = {commentary},
title = {A file the tokenizer refuses keeps its marks, under `unparsed`},
claim = {A file the tokenizer refuses keeps its marks, under `unparsed`.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_commentary.py -k test_kinds_file_an_untokenizable_source_as_unparsed},
}
@misc{pycodemod-commentary-kinds-skip-a-file-with-no-marks,
section = {commentary},
title = {An unmarked file, even an untokenizable one, contributes nothing to any kind},
claim = {An unmarked file, even an untokenizable one, contributes nothing to any kind.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_commentary.py -k test_kinds_skip_a_file_with_no_marks},
}
@misc{pycodemod-commentary-scope-index-names-the-innermost-owner,
section = {commentary},
title = {Nested defs are qualified and win over their parents; module lines have no owner},
claim = {Nested defs are qualified and win over their parents; module lines have no owner.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_commentary.py -k test_scope_index_names_the_innermost_owner},
}
@misc{pycodemod-commentary-cited-symbols-are-backticked-flags-and-names,
section = {commentary},
title = {Backticks cite; bare capitals are emphasis},
claim = {Backticks cite; bare capitals are emphasis.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_commentary.py -k test_cited_symbols_are_backticked_flags_and_names},
}
@misc{pycodemod-commentary-block-runs-to-a-blank-a-quote-or-the-next-mark,
section = {commentary},
title = {⚑⚑⚑ A paragraph is one incident, carrying its owner and its citations},
claim = { A paragraph is one incident, carrying its owner and its citations.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_commentary.py -k test_a_block_runs_to_a_blank_a_quote_or_the_next_mark},
}
@misc{pycodemod-commentary-consecutive-marks-are-separate-blocks,
section = {commentary},
title = {A marked line ends the block before it; an unparseable file still yields blocks},
claim = {A marked line ends the block before it; an unparseable file still yields blocks.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_commentary.py -k test_consecutive_marks_are_separate_blocks},
}
@misc{pycodemod-commentary-gate-names-what-a-split-lost-and-where-it-came-from,
section = {commentary},
title = {⚑ A set difference across a revision; an absent path is listed, not an error},
claim = { A set difference across a revision; an absent path is listed, not an error.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_commentary.py -k test_the_gate_names_what_a_split_lost_and_where_it_came_from},
}
@misc{pycodemod-commentary-gate-matches-both-sides-with-one-matcher,
section = {commentary},
title = {⚑⚑ With mark `NB`, "UNBALANCED" is not a mark before OR after: nothing is lost},
claim = { With mark `NB`, "UNBALANCED" is not a mark before OR after: nothing is lost.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_commentary.py -k test_the_gate_matches_both_sides_with_one_matcher},
}
@misc{pycodemod-commentary-gate-reports-an-unreadable-file,
section = {commentary},
title = {A file unreadable NOW is reported, not read as having lost everything silently},
claim = {A file unreadable NOW is reported, not read as having lost everything silently.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_commentary.py -k test_the_gate_reports_an_unreadable_file},
}
@misc{pycodemod-exit-parse-all-names-every-file-it-could-not-read,
section = {exit},
title = {⚑⚑ Unreadable, undecodable and unparseable are each a SKIP with its reason},
claim = { Unreadable, undecodable and unparseable are each a SKIP with its reason.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_exit.py -k test_parse_all_names_every_file_it_could_not_read},
}
@misc{pycodemod-exit-every-census-returns-its-own-skips,
section = {exit},
title = {⚑⚑ Skips do not accumulate across calls: the origin's list grew for ever},
claim = { Skips do not accumulate across calls: the origin's list grew for ever.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_exit.py -k test_every_census_returns_its_own_skips},
}
@misc{pycodemod-exit-module-name-is-the-flat-stem,
section = {exit},
title = {A `.py` file is its stem; anything else has no module name},
claim = {A `.py` file is its stem; anything else has no module name.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_exit.py -k test_module_name_is_the_flat_stem},
}
@misc{pycodemod-exit-main-guard-is-equality-in-either-quote,
section = {exit},
title = {⚑⚑ `!=` is not the guard; `==` is, in either quote style},
claim = { `!=` is not the guard; `==` is, in either quote style.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_exit.py -k test_the_main_guard_is_equality_in_either_quote},
}
@misc{pycodemod-exit-exit-sites-find-every-spelling-with-its-owner,
section = {exit},
title = {⚑ `raise SystemExit` is an exit; only the guard's BODY is guarded, not its else},
claim = { `raise SystemExit` is an exit; only the guard's BODY is guarded, not its else.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_exit.py -k test_exit_sites_find_every_spelling_with_its_owner},
}
@misc{pycodemod-exit-non-exits-are-not-sites,
section = {exit},
title = {A raise of another class, a bare re-raise, and calls through expressions are not exits},
claim = {A raise of another class, a bare re-raise, and calls through expressions are not exits.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_exit.py -k test_non_exits_are_not_sites},
}
@misc{pycodemod-exit-innermost-def-owns-and-async-defs-count,
section = {exit},
title = {A nested def owns its exit over its parent; an async def is a def},
claim = {A nested def owns its exit over its parent; an async def is a def.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_exit.py -k test_the_innermost_def_owns_and_async_defs_count},
}
@misc{pycodemod-exit-reached-names-are-what-other-files-spell,
section = {exit},
title = {⚑⚑⚑ `import m` reaches only what is then SPELLED; `from m import` and aliases count},
claim = { `import m` reaches only what is then SPELLED; `from m import` and aliases count.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_exit.py -k test_reached_names_are_what_other_files_spell},
}
@misc{pycodemod-exit-imported-modules-record-first-segments,
section = {exit},
title = {A dotted import is recorded under its first segment; a relative one is not recorded},
claim = {A dotted import is recorded under its first segment; a relative one is not recorded.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_exit.py -k test_imported_modules_record_first_segments},
}
@misc{pycodemod-exit-callee-is-the-bare-name-or-none,
section = {exit},
title = {`f()` and `x.f()` both name `f`; a call through an expression names nothing},
claim = {`f()` and `x.f()` both name `f`; a call through an expression names nothing.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_exit.py -k test_callee_is_the_bare_name_or_none},
}
@misc{pycodemod-exit-exits-classify-every-site-by-reach,
section = {exit},
title = {⚑⚑⚑ A def another file reaches is LIBRARY, two hops down included; the rest are not},
claim = { A def another file reaches is LIBRARY, two hops down included; the rest are not.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_exit.py -k test_exits_classify_every_site_by_reach},
}
@misc{pycodemod-exit-self-import-is-not-an-importer,
section = {exit},
title = {A module-level exit in a file only IT imports is its own process: main-only},
claim = {A module-level exit in a file only IT imports is its own process: main-only.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_exit.py -k test_a_self_import_is_not_an_importer},
}
@misc{pycodemod-exit-catchers-are-found-by-type-with-silence-and-reraise,
section = {exit},
title = {⚑⚑⚑ The handler's TYPE decides; `silent` is a bare discard; a re-raise is never silent},
claim = { The handler's TYPE decides; `silent` is a bare discard; a re-raise is never silent.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_exit.py -k test_catchers_are_found_by_type_with_silence_and_reraise},
}
@misc{pycodemod-exit-interlock-finds-the-defended-looking-site,
section = {exit},
title = {⚑⚑⚑ `except Exception` around an exiting call; not an unrelated call, not a re-raise},
claim = { `except Exception` around an exiting call; not an unrelated call, not a re-raise.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_exit.py -k test_interlock_finds_the_defended_looking_site},
}
@misc{pycodemod-exit-interlock-sees-an-exit-within-its-own-module,
section = {exit},
title = {A same-module exiting def is visible without any import; a guarded exit makes no def exit},
claim = {A same-module exiting def is visible without any import; a guarded exit makes no def
exit.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_exit.py -k test_interlock_sees_an_exit_within_its_own_module},
}
@misc{pycodemod-exit-known-misses-are-declared,
section = {exit},
title = {The census states its blind spots rather than reading a zero as a fact},
claim = {The census states its blind spots rather than reading a zero as a fact.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_exit.py -k test_known_misses_are_declared},
}
@misc{pycodemod-ambient-subtrees-are-discovered-from-the-tree-alone,
section = {ambient},
title = {⚑⚑ Visible directories only; no frozen fallback; an unlistable tree is empty},
claim = { Visible directories only; no frozen fallback; an unlistable tree is empty.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_ambient.py -k test_subtrees_are_discovered_from_the_tree_alone},
}
@misc{pycodemod-ambient-census-classifies-every-unanchored-call,
section = {ambient},
title = {⚑⚑⚑ SCOPED, REPO, UNKNOWN and MUTATES, with `getcwd` a row of its own},
claim = { SCOPED, REPO, UNKNOWN and MUTATES, with `getcwd` a row of its own.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_ambient.py -k test_the_census_classifies_every_unanchored_call},
}
@misc{pycodemod-ambient-census-reports-what-it-could-not-read,
section = {ambient},
title = {⚑⚑ Undecodable, unreadable and unparseable are skips; the population counts them all},
claim = { Undecodable, unreadable and unparseable are skips; the population counts them all.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_ambient.py -k test_the_census_reports_what_it_could_not_read},
}
@misc{pycodemod-ambient-anchoring-follows-the-head-of-the-expression,
section = {ambient},
title = {⚑ A join, a sum and an f-string are anchored by their HEAD; `__file__` anchors anywhere},
claim = { A join, a sum and an f-string are anchored by their HEAD; `__file__` anchors anywhere.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_ambient.py -k test_anchoring_follows_the_head_of_the_expression},
}
@misc{pycodemod-ambient-path-arg-reads-the-argv-head-and-the-path-keywords,
section = {ambient},
title = {⚑⚑ A subprocess argv's head is the path; an empty argv and no path argument give None},
claim = { A subprocess argv's head is the path; an empty argv and no path argument give None.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_ambient.py -k test_path_arg_reads_the_argv_head_and_the_path_keywords},
}
@misc{pycodemod-ambient-callee-name-is-unqualified,
section = {ambient},
title = {`os.path.exists` and `exists` both name `exists`; a call through an expression names none},
claim = {`os.path.exists` and `exists` both name `exists`; a call through an expression names
none.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_ambient.py -k test_callee_name_is_unqualified},
}
@misc{pycodemod-ambient-known-misses-are-declared,
section = {ambient},
title = {The census states its blind spots, keyed, rather than reading a zero as a fact},
claim = {The census states its blind spots, keyed, rather than reading a zero as a fact.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_ambient.py -k test_known_misses_are_declared},
}
@misc{pycodemod-sites-dotted-target-matches-the-whole-receiver-exactly,
section = {sites},
title = {⚑⚑ `store.connect` is not `sqlite3.connect` on the same line, nor `x.store.connect`},
claim = { `store.connect` is not `sqlite3.connect` on the same line, nor `x.store.connect`.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_sites.py -k test_a_dotted_target_matches_the_whole_receiver_exactly},
}
@misc{pycodemod-sites-two-calls-on-one-line-keep-their-own-facts,
section = {sites},
title = {⚑⚑ Facts are keyed by span: the sqlite call keeps its receiver and its argument},
claim = { Facts are keyed by span: the sqlite call keeps its receiver and its argument.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_sites.py -k test_two_calls_on_one_line_keep_their_own_facts},
}
@misc{pycodemod-sites-nested-calls-sharing-a-start-keep-their-own-facts,
section = {sites},
title = {⚑⚑ `a().b()`: inner and outer start at one column; the span tells them apart},
claim = { `a().b()`: inner and outer start at one column; the span tells them apart.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_sites.py -k test_nested_calls_sharing_a_start_keep_their_own_facts},
}
@misc{pycodemod-sites-called-attribute-is-not-also-a-reference,
section = {sites},
title = {⚑⚑ Five calls of `connect`, and not one of them doubles as a ref},
claim = { Five calls of `connect`, and not one of them doubles as a ref.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_sites.py -k test_a_called_attribute_is_not_also_a_reference},
}
@misc{pycodemod-sites-else-is-guarded-by-the-negated-test,
section = {sites},
title = {⚑⚑ The body carries the test, the else carries `not (test)`, and an elif chain composes},
claim = { The body carries the test, the else carries `not (test)`, and an elif chain composes.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_sites.py -k test_an_else_is_guarded_by_the_negated_test},
}
@misc{pycodemod-sites-context-is-the-qualified-enclosing-scope,
section = {sites},
title = {⚑ A method reads `K.m`, a nested def `K.m.inner`, module level `<module>`},
claim = { A method reads `K.m`, a nested def `K.m.inner`, module level `<module>`.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_sites.py -k test_the_context_is_the_qualified_enclosing_scope},
}
@misc{pycodemod-sites-bindings-and-labels-are-not-uses,
section = {sites},
title = {⚑ A parameter and a keyword label are not refs},
claim = { A parameter and a keyword label are not refs. A value use, an attribute read and a
decorator registration are.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_sites.py -k test_bindings_and_labels_are_not_uses},
}
@misc{pycodemod-sites-call-facts-carry-every-reading,
section = {sites},
title = {Keywords, shapes, constants, positional values and their source text, from one walk},
claim = {Keywords, shapes, constants, positional values and their source text, from one walk.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_sites.py -k test_call_facts_carry_every_reading},
}
@misc{pycodemod-sites-result-carries-its-query-and-reports-every-skip,
section = {sites},
title = {⚑⚑⚑ Target and population ride the result; unread files are skips},
claim = { Target and population ride the result; unread files are skips. A file without the name
is excluded, not skipped.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_sites.py -k test_the_result_carries_its_query_and_reports_every_skip},
}
@misc{pycodemod-sites-visitor-bug-raises-rather-than-emptying-the-query,
section = {sites},
title = {⚑⚑⚑ A defect in the walk is a property of the QUERY: it must raise, never read as a skip},
claim = { A defect in the walk is a property of the QUERY: it must raise, never read as a skip.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_sites.py -k test_a_visitor_bug_raises_rather_than_emptying_the_query},
}
@misc{pycodemod-sites-dotted-spells-only-name-and-attribute-chains,
section = {sites},
title = {`a.b.c` is spelled; anything with a call or subscript in the chain is not},
claim = {`a.b.c` is spelled; anything with a call or subscript in the chain is not.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_sites.py -k test_dotted_spells_only_name_and_attribute_chains},
}
@misc{pycodemod-sites-double-star-is-a-splat-not-a-positional,
section = {sites},
title = {⚑⚑ `*rest` holds an ordinal; `**cfg` holds none, and it opens the keyword set},
claim = { `*rest` holds an ordinal; `**cfg` holds none, and it opens the keyword set.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_sites.py -k test_a_double_star_is_a_splat_not_a_positional},
}
@misc{pycodemod-arguments-forwards-has-a-side-for-the-splat,
section = {arguments},
title = {⚑⚑ Passes, lacks, and cannot-tell: a `**cfg` call is never counted as lacking},
claim = { Passes, lacks, and cannot-tell: a `**cfg` call is never counted as lacking.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_arguments.py -k test_forwards_has_a_side_for_the_splat},
}
@misc{pycodemod-arguments-asserted-splits-literal-from-computed,
section = {arguments},
title = {`None` is a literal; a name is computed; a call not passing the keyword is on no side},
claim = {`None` is a literal; a name is computed; a call not passing the keyword is on no side.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_arguments.py -k test_asserted_splits_literal_from_computed},
}
@misc{pycodemod-arguments-values-report-the-constant-or-unknown-over-the-total,
section = {arguments},
title = {⚑⚑ Never a guess: `k=x` is UNKNOWN, `k=None` is None, and the denominator is every call},
claim = { Never a guess: `k=x` is UNKNOWN, `k=None` is None, and the denominator is every call.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_arguments.py -k test_values_report_the_constant_or_unknown_over_the_total},
}
@misc{pycodemod-arguments-int-reads-a-position,
section = {arguments},
title = {An ordinal reads the positional argument; a `**` splat holds no position},
claim = {An ordinal reads the positional argument; a `**` splat holds no position.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_arguments.py -k test_an_int_reads_a_position},
}
@misc{pycodemod-arguments-guarded-splits-calls-under-a-test-from-the-top,
section = {arguments},
title = {A call under `if a:` carries the test; every other call is at the top of its scope},
claim = {A call under `if a:` carries the test; every other call is at the top of its scope.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_arguments.py -k test_guarded_splits_calls_under_a_test_from_the_top},
}
@misc{pycodemod-arguments-values-many-reads-several-callees-from-one-scan,
section = {arguments},
title = {Each callee's rows and total, from one unnarrowed scan; an absent callee has total 0},
claim = {Each callee's rows and total, from one unnarrowed scan; an absent callee has total 0.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_arguments.py -k test_values_many_reads_several_callees_from_one_scan},
}
@misc{pycodemod-arguments-values-many-refuses-a-narrowed-scan,
section = {arguments},
title = {⚑⚑ A scan narrowed to `f` would report `g` as never called: a zero about the scan},
claim = { A scan narrowed to `f` would report `g` as never called: a zero about the scan.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_arguments.py -k test_values_many_refuses_a_narrowed_scan},
}
@misc{pycodemod-arguments-calls-filter-by-callee-in-span-order,
section = {arguments},
title = {`calls` keeps span order and filters by callee name when asked},
claim = {`calls` keeps span order and filters by callee name when asked.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_arguments.py -k test_calls_filter_by_callee_in_span_order},
}
@misc{pycodemod-arguments-missing-renders-as-a-word,
section = {arguments},
title = {The not-passed sentinel renders as a word, never as data},
claim = {The not-passed sentinel renders as a word, never as data.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_arguments.py -k test_missing_renders_as_a_word},
}
@misc{pycodemod-dead-prose-mention-does-not-excuse-a-dead-def,
section = {dead},
title = {⚑⚑ A name quoted in a docstring or comment is not a dispatch: `ghost`, `ghost2` are dead},
claim = { A name quoted in a docstring or comment is not a dispatch: `ghost`, `ghost2` are dead.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_dead.py -k test_a_prose_mention_does_not_excuse_a_dead_def},
}
@misc{pycodemod-dead-every-exemption-is-reported-with-its-reason,
section = {dead},
title = {⚑⚑⚑ An excused def is a visible row naming its rule — a single-quoted dispatch included},
claim = { An excused def is a visible row naming its rule — a single-quoted dispatch included.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_dead.py -k test_every_exemption_is_reported_with_its_reason},
}
@misc{pycodemod-dead-call-or-a-use-as-value-is-a-use,
section = {dead},
title = {`live()` is a call and `callbacks=[cb]` a use as a value: neither def is dead or exempt},
claim = {`live()` is a call and `callbacks=[cb]` a use as a value: neither def is dead or exempt.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_dead.py -k test_a_call_or_a_use_as_value_is_a_use},
}
@misc{pycodemod-dead-narrowed-scan-is-refused,
section = {dead},
title = {⚑⚑ "No caller in this population" over one name reads live code as dead},
claim = { "No caller in this population" over one name reads live code as dead.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_dead.py -k test_a_narrowed_scan_is_refused},
}
@misc{pycodemod-dead-unread-file-is-reported-once,
section = {dead},
title = {A file both readers refuse is one skip, not two},
claim = {A file both readers refuse is one skip, not two.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_dead.py -k test_an_unread_file_is_reported_once},
}
@misc{pycodemod-dead-string-constants-exclude-docstrings-and-report-unread,
section = {dead},
title = {Code strings are collected; docstrings are prose; an unreadable file is a skip},
claim = {Code strings are collected; docstrings are prose; an unreadable file is a skip.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_dead.py -k test_string_constants_exclude_docstrings_and_report_unread},
}
@misc{pycodemod-dead-framework-prefix-needs-a-name-after-it,
section = {dead},
title = {`visit_Call` satisfies the libcst contract; a bare `on_` satisfies nothing},
claim = {`visit_Call` satisfies the libcst contract; a bare `on_` satisfies nothing.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_dead.py -k test_a_framework_prefix_needs_a_name_after_it},
}
@misc{pycodemod-imports-dotted-module-is-found-with-every-form,
section = {imports},
title = {⚑⚑⚑ `pkg.sub` matches itself, its submodules and its parent's import — not `pkg.subtle`},
claim = { `pkg.sub` matches itself, its submodules and its parent's import — not `pkg.subtle`.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_imports.py -k test_a_dotted_module_is_found_with_every_form},
}
@misc{pycodemod-imports-top-level-module-reports-the-names-each-import-takes,
section = {imports},
title = {`import a.b` binds `a`; a from-import reports every name it selects},
claim = {`import a.b` binds `a`; a from-import reports every name it selects.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_imports.py -k test_a_top_level_module_reports_the_names_each_import_takes},
}
@misc{pycodemod-imports-names-module-is-a-segment-boundary-not-a-prefix,
section = {imports},
title = {`pkg.subtle` is not a submodule of `pkg.sub`},
claim = {`pkg.subtle` is not a submodule of `pkg.sub`.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_imports.py -k test_names_module_is_a_segment_boundary_not_a_prefix},
}
@misc{pycodemod-imports-attribute-read-is-found-on-any-receiver-with-its-scope,
section = {imports},
title = {⚑ `.name` matches every receiver — spaced, expression, or `self` — each with its scope},
claim = { `.name` matches every receiver — spaced, expression, or `self` — each with its scope.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_imports.py -k test_an_attribute_read_is_found_on_any_receiver_with_its_scope},
}
@misc{pycodemod-imports-dotted-receiver-reads-every-attribute-off-it,
section = {imports},
title = {⚑ `pkg.mod.*` is exact: it reads `run` and `other` off `pkg.mod`, never `pkg.run`},
claim = { `pkg.mod.*` is exact: it reads `run` and `other` off `pkg.mod`, never `pkg.run`.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_imports.py -k test_a_dotted_receiver_reads_every_attribute_off_it},
}
@misc{pycodemod-imports-both-readers-report-every-file-they-could-not-read,
section = {imports},
title = {⚑⚑ An unread file is a skip, never an empty result},
claim = { An unread file is a skip, never an empty result.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_imports.py -k test_both_readers_report_every_file_they_could_not_read},
}
@misc{pycodemod-swallows-every-kind-and-every-silent-exit-is-found,
section = {swallows},
title = {⚑⚑ A tuple holding `Exception` is broad; a dotted BaseException is base; five exits},
claim = { A tuple holding `Exception` is broad; a dotted BaseException is base; five exits.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_swallows.py -k test_every_kind_and_every_silent_exit_is_found},
}
@misc{pycodemod-swallows-feeds-is-a-later-read-in-the-same-scope,
section = {swallows},
title = {⚑⚑ An accumulator and a later-read target feed; output, scaffolding, other scopes do not},
claim = { An accumulator and a later-read target feed; output, scaffolding, other scopes do not.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_swallows.py -k test_feeds_is_a_later_read_in_the_same_scope},
}
@misc{pycodemod-swallows-handler-that-does-anything-else-is-not-a-swallow,
section = {swallows},
title = {`log(); pass` accounts for the failure: that module-level handler is not reported},
claim = {`log(); pass` accounts for the failure: that module-level handler is not reported.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_swallows.py -k test_a_handler_that_does_anything_else_is_not_a_swallow},
}
@misc{pycodemod-swallows-except-star-handler-is-read,
section = {swallows},
title = {An exception-group handler discards as silently as a plain one},
claim = {An exception-group handler discards as silently as a plain one.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_swallows.py -k test_an_except_star_handler_is_read},
}
@misc{pycodemod-swallows-census-reports-every-file-it-could-not-read,
section = {swallows},
title = {⚑⚑⚑ The census of silent swallows must not swallow: undecodable, unparseable, unreadable},
claim = { The census of silent swallows must not swallow: undecodable, unparseable, unreadable.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_swallows.py -k test_the_census_reports_every_file_it_could_not_read},
}
@misc{pycodemod-graph-caller-is-its-file-and-qualified-scope,
section = {graph},
title = {⚑⚑⚑ Same-stem files and same-named methods are distinct callers},
claim = { Same-stem files and same-named methods are distinct callers.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_graph.py -k test_a_caller_is_its_file_and_qualified_scope},
}
@misc{pycodemod-graph-reach-follows-same-file-hops-to-a-target,
section = {graph},
title = {`f` reaches `write` through `g` and `h`, and the walk finished inside the bound},
claim = {`f` reaches `write` through `g` and `h`, and the walk finished inside the bound.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_graph.py -k test_reach_follows_same_file_hops_to_a_target},
}
@misc{pycodemod-graph-reach-says-when-the-bound-stopped-it,
section = {graph},
title = {⚑⚑ At depth 1 `write` is not found AND the walk says it stopped — not "unreachable"},
claim = { At depth 1 `write` is not found AND the walk says it stopped — not "unreachable".},
check = {cmd:.venv/bin/python3 -m pytest tests/test_graph.py -k test_reach_says_when_the_bound_stopped_it},
}
@misc{pycodemod-graph-unknown-start-is-not-a-start-that-reaches-nothing,
section = {graph},
title = {⚑⚑ The origin returned an empty dict for both; the reach says which},
claim = { The origin returned an empty dict for both; the reach says which.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_graph.py -k test_an_unknown_start_is_not_a_start_that_reaches_nothing},
}
@misc{pycodemod-graph-callgraph-refuses-a-narrowed-scan,
section = {graph},
title = {A graph over one name's calls would omit every other edge},
claim = {A graph over one name's calls would omit every other edge.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_graph.py -k test_callgraph_refuses_a_narrowed_scan},
}
@misc{pycodemod-graph-verdict-returners-keep-every-file-and-read-exit-codes,
section = {graph},
title = {⚑⚑ 0/1 and -1 are verdicts; data and one return are not; a name in two files stays twice},
claim = { 0/1 and -1 are verdicts; data and one return are not; a name in two files stays twice.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_graph.py -k test_verdict_returners_keep_every_file_and_read_exit_codes},
}
@misc{pycodemod-graph-verdict-returners-report-every-file-they-could-not-read,
section = {graph},
title = {⚑⚑ The origin's `except Exception: continue` dropped these; each is now a skip},
claim = { The origin's `except Exception: continue` dropped these; each is now a skip.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_graph.py -k test_verdict_returners_report_every_file_they_could_not_read},
}
@misc{pycodemod-ordering-reifies-finds-every-shape-and-not-an-integer-counter,
section = {ordering},
title = {⚑⚑ Literals, comprehensions, builders and accumulators are found; `n += 1` is not one},
claim = { Literals, comprehensions, builders and accumulators are found; `n += 1` is not one.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_ordering.py -k test_reifies_finds_every_shape_and_not_an_integer_counter},
}
@misc{pycodemod-ordering-resorts-pair-a-consumer-with-its-producer,
section = {ordering},
title = {⚑⚑ A redundant re-sort, a rekeyed one, and neither for an unknown producer — each located},
claim = { A redundant re-sort, a rekeyed one, and neither for an unknown producer — each located.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_ordering.py -k test_resorts_pair_a_consumer_with_its_producer},
}
@misc{pycodemod-ordering-both-censuses-report-every-file-they-could-not-read,
section = {ordering},
title = {⚑ An unread file is a skip in each census, never an empty result},
claim = { An unread file is a skip in each census, never an empty result.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_ordering.py -k test_both_censuses_report_every_file_they_could_not_read},
}
@misc{pycodemod-strings-key-is-read-written-deleted-or-declared,
section = {strings},
title = {⚑⚑ Each use by kind: a write and a delete are not reads; a dict display declares},
claim = { Each use by kind: a write and a delete are not reads; a dict display declares.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_strings.py -k test_a_key_is_read_written_deleted_or_declared},
}
@misc{pycodemod-strings-key-spelled-with-an-escape-is-found,
section = {strings},
title = {⚑ The prefilter must not reject a file whose literal spells the key with an escape},
claim = { The prefilter must not reject a file whose literal spells the key with an escape.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_strings.py -k test_a_key_spelled_with_an_escape_is_found},
}
@misc{pycodemod-strings-may-hold-rejects-only-what-cannot-be-there,
section = {strings},
title = {A plain value must appear verbatim; any other value might be escaped, so is not rejected},
claim = {A plain value must appear verbatim; any other value might be escaped, so is not
rejected.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_strings.py -k test_may_hold_rejects_only_what_cannot_be_there},
}
@misc{pycodemod-strings-literal-is-classified-by-the-role-it-plays,
section = {strings},
title = {⚑⚑ f-string text and an async def's docstring are seen; each role is the enclosing one},
claim = { f-string text and an async def's docstring are seen; each role is the enclosing one.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_strings.py -k test_a_literal_is_classified_by_the_role_it_plays},
}
@misc{pycodemod-strings-both-readers-report-every-file-they-could-not-read,
section = {strings},
title = {⚑⚑ The origin's bare `except Exception: continue` dropped these; each is now a skip},
claim = { The origin's bare `except Exception: continue` dropped these; each is now a skip.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_strings.py -k test_both_readers_report_every_file_they_could_not_read},
}
@misc{pycodemod-definitions-every-binding-is-live-over-its-own-scope,
section = {definitions},
title = {⚑⚑ Comprehension, global and def each live where Python binds them; except and match bind},
claim = { Comprehension, global and def each live where Python binds them; except and match bind.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_definitions.py -k test_every_binding_is_live_over_its_own_scope},
}
@misc{pycodemod-definitions-source-starts-at-the-first-decorator,
section = {definitions},
title = {⚑ A decorated def's source includes its decorators; a method carries its class},
claim = { A decorated def's source includes its decorators; a method carries its class.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_definitions.py -k test_source_starts_at_the_first_decorator},
}
@misc{pycodemod-definitions-failure-is-a-skip-never-a-row,
section = {definitions},
title = {⚑⚑⚑ The origin returned failures AS bindings; here each is a skip and no row appears},
claim = { The origin returned failures AS bindings; here each is a skip and no row appears.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_definitions.py -k test_a_failure_is_a_skip_never_a_row},
}
@misc{pycodemod-funcnames-each-func-call-is-graded-by-the-real-registry,
section = {funcnames},
title = {⚑⚑ A registry name is generic and anything else verbatim, asked of the installed SQLAlchemy},
claim = { A registry name is generic and anything else verbatim, asked of the installed
SQLAlchemy. Measured on the origin: string_agg and an invented name share
one bucket, verbatim.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_funcnames.py -k test_each_func_call_is_graded_by_the_real_registry},
}
@misc{pycodemod-funcnames-lookup-ignores-case-as-sqlalchemy-does,
section = {funcnames},
title = {⚑⚑ COUNT and Coalesce are generic: SQLAlchemy 2.1.1 builds the generic class for them},
claim = { COUNT and Coalesce are generic: SQLAlchemy 2.1.1 builds the generic class for them. The
origin compared the exact spelling and graded both verbatim.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_funcnames.py -k test_the_lookup_ignores_case_as_sqlalchemy_does},
}
@misc{pycodemod-funcnames-async-def-is-its-own-caller,
section = {funcnames},
title = {⚑ A call inside an async def is attributed to it, not to an outer function or the module},
claim = { A call inside an async def is attributed to it, not to an outer function or the module.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_funcnames.py -k test_an_async_def_is_its_own_caller},
}
@misc{pycodemod-funcnames-only-the-name-func-is-a-receiver,
section = {funcnames},
title = {⚑ `node.func(...)` and `sa.func.count(...)` are not SQLAlchemy's bare `func` receiver},
claim = { `node.func(...)` and `sa.func.count(...)` are not SQLAlchemy's bare `func` receiver.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_funcnames.py -k test_only_the_name_func_is_a_receiver},
}
@misc{pycodemod-funcnames-given-registry-is-used-instead-of-asking,
section = {funcnames},
title = {A caller may pass the generic names; then only those are generic},
claim = {A caller may pass the generic names; then only those are generic.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_funcnames.py -k test_a_given_registry_is_used_instead_of_asking},
}
@misc{pycodemod-funcnames-empty-or-moved-registry-refuses,
section = {funcnames},
title = {⚑⚑ No generic names refuses loudly; it never grades every call verbatim},
claim = { No generic names refuses loudly; it never grades every call verbatim.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_funcnames.py -k test_an_empty_or_moved_registry_refuses},
}
@misc{pycodemod-funcnames-generic-names-are-lowercased,
section = {funcnames},
title = {The asked names are lowercased so the lookup is case-insensitive},
claim = {The asked names are lowercased so the lookup is case-insensitive.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_funcnames.py -k test_the_generic_names_are_lowercased},
}
@misc{pycodemod-funcnames-without-sqlalchemy-the-module-refuses-at-import,
section = {funcnames},
title = {⚑⚑⚑ Without the optional extra, importing funcnames raises ImportError naming the extra},
claim = { Without the optional extra, importing funcnames raises ImportError naming the extra.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_funcnames.py -k test_without_sqlalchemy_the_module_refuses_at_import},
}
@misc{pycodemod-funcnames-unread-file-is-reported-as-skipped,
section = {funcnames},
title = {⚑ A file that cannot be read or parsed is skipped with its reason, never silently dropped},
claim = { A file that cannot be read or parsed is skipped with its reason, never silently
dropped.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_funcnames.py -k test_an_unread_file_is_reported_as_skipped},
}
@misc{pycodemod-rivals-one-line-wrapper-delegates-and-a-body-reimplements,
section = {rivals},
title = {⚑⚑ A def whose only statement returns a call DELEGATES; any other body REIMPLEMENTS},
claim = { A def whose only statement returns a call DELEGATES; any other body REIMPLEMENTS. The
docstring is prose and does not count as a statement.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_rivals.py -k test_a_one_line_wrapper_delegates_and_a_body_reimplements},
}
@misc{pycodemod-rivals-awaited-call-delegates,
section = {rivals},
title = {⚑⚑ `return await f(...)` delegates; the origin read an async wrapper as reimplementing},
claim = { `return await f(...)` delegates; the origin read an async wrapper as reimplementing.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_rivals.py -k test_an_awaited_call_delegates},
}
@misc{pycodemod-rivals-def-with-two-spaces-is-still-found,
section = {rivals},
title = {⚑ The origin's substring prefilter missed `def spaced`; the parse does not},
claim = { The origin's substring prefilter missed `def spaced`; the parse does not.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_rivals.py -k test_a_def_with_two_spaces_is_still_found},
}
@misc{pycodemod-rivals-prose-only-body-reimplements-with-no-statements,
section = {rivals},
title = {A def holding only a docstring adds no delegation: REIMPLEMENTS, zero statements},
claim = {A def holding only a docstring adds no delegation: REIMPLEMENTS, zero statements.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_rivals.py -k test_a_prose_only_body_reimplements_with_no_statements},
}
@misc{pycodemod-rivals-collisions-are-public-names-with-two-reimplementing-bodies,
section = {rivals},
title = {⚑⚑ Delegating defs and private names do not collide; two real bodies under one name do},
claim = { Delegating defs and private names do not collide; two real bodies under one name do.
files has one reimplementing body and two wrappers, so it does not collide;
fetch has two bodies once the third file is added; _private is private.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_rivals.py -k test_collisions_are_public_names_with_two_reimplementing_bodies},
}
@misc{pycodemod-rivals-unread-file-is-skipped-by-both,
section = {rivals},
title = {⚑⚑⚑ A file that cannot be read or parsed is skipped, with its reason, by both queries},
claim = { A file that cannot be read or parsed is skipped, with its reason, by both queries.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_rivals.py -k test_an_unread_file_is_skipped_by_both},
}
@misc{pycodemod-placement-guard-in-the-entry-block-fires-at-entry,
section = {placement},
title = {A guard at module scope inside the `__main__` block is `entry`},
claim = {A guard at module scope inside the `__main__` block is `entry`.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_placement.py -k test_a_guard_in_the_entry_block_fires_at_entry},
}
@misc{pycodemod-placement-guard-under-a-dispatch-condition-is-dispatched,
section = {placement},
title = {A guard under a mode test inside the block is `dispatched`: written, not fired},
claim = {A guard under a mode test inside the block is `dispatched`: written, not fired.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_placement.py -k test_a_guard_under_a_dispatch_condition_is_dispatched},
}
@misc{pycodemod-placement-comment-at-column-zero-does-not-end-the-block,
section = {placement},
title = {⚑⚑⚑ The entry block is the `if` itself, not an indentation span},
claim = { The entry block is the `if` itself, not an indentation span. The origin ended the span
at the column-0 comment, so this guard read `dispatched`.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_placement.py -k test_a_comment_at_column_zero_does_not_end_the_block},
}
@misc{pycodemod-placement-one-hop-follows-the-callers-scope,
section = {placement},
title = {⚑⚑ A guard in a def is `entry` only if the block calls that def at module scope, unguarded},
claim = { A guard in a def is `entry` only if the block calls that def at module scope,
unguarded. A helper DEFINED in the block runs nothing; the origin matched it
by line range.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_placement.py -k test_one_hop_follows_the_callers_scope},
}
@misc{pycodemod-placement-script-with-no-main-block-runs-at-entry,
section = {placement},
title = {⚑⚑ With no `__main__` block, module scope IS the entry, for a direct call and one hop},
claim = { With no `__main__` block, module scope IS the entry, for a direct call and one hop. The
origin's one-hop check refused a def called from module scope for want of a
span.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_placement.py -k test_a_script_with_no_main_block_runs_at_entry},
}
@misc{pycodemod-placement-else-of-the-main-block-is-dispatched,
section = {placement},
title = {An `else` of the entry test runs on import, never on invocation: `dispatched`},
claim = {An `else` of the entry test runs on import, never on invocation: `dispatched`.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_placement.py -k test_the_else_of_the_main_block_is_dispatched},
}
@misc{pycodemod-placement-either-operand-order-and-quote-is-the-entry-test,
section = {placement},
title = {`'__main__' == __name__` is the entry test as much as the usual spelling},
claim = {`'__main__' == __name__` is the entry test as much as the usual spelling.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_placement.py -k test_either_operand_order_and_quote_is_the_entry_test},
}
@misc{pycodemod-placement-method-or-async-def-reached-from-the-block-is-entry,
section = {placement},
title = {⚑ A method's scope is qualified by its class; the block calls it by its own name},
claim = { A method's scope is qualified by its class; the block calls it by its own name.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_placement.py -k test_a_method_or_async_def_reached_from_the_block_is_entry},
}
@misc{pycodemod-placement-first-write-form-is-first-write-and-entry-outranks-it,
section = {placement},
title = {`_snapshot_once` is `first-write`; a file that also guards at entry earns `entry`},
claim = {`_snapshot_once` is `first-write`; a file that also guards at entry earns `entry`.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_placement.py -k test_a_first_write_form_is_first_write_and_entry_outranks_it},
}
@misc{pycodemod-placement-first-write-forms-are-the-callers,
section = {placement},
title = {Forms passed as first-write are graded first-write, whatever their name},
claim = {Forms passed as first-write are graded first-write, whatever their name.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_placement.py -k test_the_first_write_forms_are_the_callers},
}
@misc{pycodemod-placement-entry-test-is-exactly-the-comparison,
section = {placement},
title = {Only `__name__ == "__main__"`, in either order, is the entry test},
claim = {Only `__name__ == "__main__"`, in either order, is the entry test.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_placement.py -k test_the_entry_test_is_exactly_the_comparison},
}
@misc{pycodemod-placement-unreadable-file-is-skipped-and-the-limits-are-returned,
section = {placement},
title = {⚑ A file the scan could not read is skipped; what cannot be decided rides every result},
claim = { A file the scan could not read is skipped; what cannot be decided rides every result.},
check = {cmd:.venv/bin/python3 -m pytest tests/test_placement.py -k test_an_unreadable_file_is_skipped_and_the_limits_are_returned},
}