1 minor finding
Findings
[minor] · Copyright lint accepts notices outside the file header
The copyright lint can accept matching notice lines later in a file instead of a leading header; no current scanned file triggering this false negative was found.
Location: test/lint/test_runner/src/lint_docs.rs:18 (head).
Details and suggested fix
has_copyright_header searches all of text.lines() for the attribution, then searches the remaining lines for the MIT notice and checks its immediately following line for file COPYING or http. A scanned file with code first and the three matching comment lines later therefore returns true even though it has no leading notice. Restrict the search to the leading comment region, allowing a shebang before it, so a notice elsewhere cannot substitute for the file's header.
Background
Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.
Documented decisions
#34084 intentionally permitted multiple date formats, including omitting dates entirely for new code. Its stated reasons were that annual updates caused churn, dates could become inaccurate through code moves or cherry-picks, and Git provided more accurate history. It explicitly left developers free to choose their style.
The pinned parser does not validate the material between the initial 'Copyright' and final 'Bitcoin Core developers'. Consequently, dated, '-present', and undated versions of that attribution remain compatible with the documented formatting freedom.
The referenced #34106 comment proposed pairing missing-header additions with a linter. Its visible proposal already used the Core-developer attribution suffix, the 'Distributed under the MIT software license' prefix, and a following 'file COPYING or http' line. This was a proposed enforcement convention, not an accompanying explanation that copyright policy legally required those exact strings.
The current parser preserves those visible checks from the historical proposal. The comment supports the provenance of the enforcement approach, but its truncated record cannot establish the intended scope of third-party exceptions or a broader agreement about mandatory wording.
Ralph's inferences
The pinned copyright policy distinguishes licensing from project attribution: contributions default to MIT unless otherwise specified in contrib/debian/copyright or at the top of the file, while work contributed by someone other than its original author must retain a license header identifying the original authors and source. It does not itself prescribe a universal 'Bitcoin Core developers' attribution or exact MIT-notice wording.
The parser expresses a specific project-header convention rather than the full policy. Third-party attribution is accommodated through inherited exclusions and an explicit 'External copyright' list, including asmap files, tinyformat.h, authproxy.py, key.py, and segwit_addr.py. Thus exceptions remain structurally possible without adding Core attribution to those files; however, the inspected history does not establish the intended completeness of that list.
The parser preserves flexibility in dates and license URLs, but recognizes a particular textual layout: after stripping '// ' or '# ', it requires the Core-attribution suffix, then the MIT-distribution prefix, followed immediately by a line beginning 'file COPYING or http'. It does not require an exact URL or the complete canonical sentence.
For the explicitly documented date-format decisions, preservation is clear. For attribution and MIT wording, the evidence supports a narrower conclusion: the parser follows the visible #34106 proposal and accepts the existing undated header in the lint module, but the broader copyright policy also permits file-specific licensing and original-author notices. Those policy permissions are represented through exclusions rather than through general recognition of alternative headers.