Commit 2bb0ce7
committed
fix(config): keep a file's per-file-ignores out of the workspace index it feeds
A run over files filtered each file's rules by its `per-file-ignores` before
linting it, and the same filtered set built the index the cross-file checks
resolve against. MD051 is the only rule that records a file's headings, so
`"target.md" = ["MD051"]` erased target.md from the index and every link
elsewhere pointing at one of its anchors reported as broken. The finding named
a file and a rule the reader never configured, and the fragment it called
missing was there in the target all along.
Per-file-ignores decides what a file REPORTS. What a file contributes to the
workspace belongs to the workspace: its headings answer links written in other
files, whose own configuration says nothing about it. `lint_and_index` now
applies the ignores to the rules it runs and keeps every cross-file rule for
the index it builds, so the full rule set can go in. That is how the cache-hit
path and the stdin path already build an index, so all three now agree.
The ignore itself is unchanged: the file that names a rule reports nothing from
it, on its own lines or through a cross-file check, and an embedded markdown
block is part of that file so it is still linted with the reduced set.
The persisted workspace index carries the old meaning, and content is what
decides whether an entry is reused, so an unchanged file would have kept its
gap and the fixed build would have gone on reporting the false positive from
the cache the previous one wrote. Its format version is bumped to rebuild.1 parent e215c65 commit 2bb0ce7
4 files changed
Lines changed: 93 additions & 22 deletions
File tree
- src
- file_processor
- tests/config
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
908 | 908 | | |
909 | 909 | | |
910 | 910 | | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | | - | |
917 | | - | |
918 | | - | |
919 | | - | |
920 | | - | |
921 | | - | |
922 | | - | |
923 | | - | |
924 | | - | |
925 | 911 | | |
926 | 912 | | |
927 | 913 | | |
928 | | - | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
929 | 921 | | |
930 | 922 | | |
931 | 923 | | |
932 | | - | |
| 924 | + | |
933 | 925 | | |
934 | 926 | | |
935 | 927 | | |
| |||
938 | 930 | | |
939 | 931 | | |
940 | 932 | | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
941 | 947 | | |
942 | 948 | | |
943 | 949 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
406 | 417 | | |
407 | 418 | | |
408 | 419 | | |
| |||
422 | 433 | | |
423 | 434 | | |
424 | 435 | | |
425 | | - | |
| 436 | + | |
426 | 437 | | |
427 | 438 | | |
| 439 | + | |
428 | 440 | | |
429 | 441 | | |
430 | 442 | | |
| |||
527 | 539 | | |
528 | 540 | | |
529 | 541 | | |
530 | | - | |
| 542 | + | |
| 543 | + | |
531 | 544 | | |
532 | 545 | | |
533 | 546 | | |
534 | 547 | | |
535 | 548 | | |
| 549 | + | |
536 | 550 | | |
537 | 551 | | |
538 | 552 | | |
| |||
555 | 569 | | |
556 | 570 | | |
557 | 571 | | |
558 | | - | |
559 | | - | |
560 | | - | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
561 | 576 | | |
562 | 577 | | |
563 | 578 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
292 | 298 | | |
293 | | - | |
| 299 | + | |
294 | 300 | | |
295 | 301 | | |
296 | 302 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
600 | 600 | | |
601 | 601 | | |
602 | 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 | + | |
0 commit comments