Repository navigation
Description
CopyrightConfig declares a patterns field, defaults it per language, and the Starlark never reads
it. It is a documented configuration surface that does nothing, and its design contradicts every ruling
made about the header on 2026-09-30.
From cmd/star/extensions/com.noblefactor.star.LintCopyright/extension.yaml:
config:
path: lint.copyright
type: CopyrightConfig
fields:
patterns: "map[string]interface{}"
defaults:
patterns:
go:
match: '// SPDX-License-Identifier: \S+\s*\n// Copyright.*All rights reserved\.'
replace: "// SPDX-License-Identifier: {license}\n// Copyright {holder}. All rights reserved."
star:
match: '# SPDX-License-Identifier: \S+\s*\n# Copyright.*All rights reserved\.'
replace: "# SPDX-License-Identifier: {license}\n# Copyright {holder}. All rights reserved."
shell:
...lint-copyright.star uses SPDX_PATTERN, COPYRIGHT_PATTERN, build_expected_header and COMMENT_STYLES,
all hardcoded. patterns appears nowhere in it.
Why it cannot simply be implemented
It contradicts three rulings of 2026-09-30, recorded on
#994's plan:
patterns as declared |
The ruling |
|---|---|
One template per language -- a go:, a star:, a shell: entry, each repeating the same sentence with a different comment marker |
"The template is the text; the comment prefix is the linter's." COMMENT_STYLES derives //, #, -- from the extension, so a consumer writes one template, not one per language they use |
{license} and {holder} placeholders -- a fourth templating syntax in a codebase that already ships one |
Go template syntax, because pkg/op/provider/template already wraps text/template and Starlark already reaches it. "Inventing a {year} mini-syntax would put a second templating language beside one the codebase already has" |
A match regex beside the replace -- check and fix described separately, which is how they drift |
"check_file should be setup to ensure check_file requires exactly what fix_file produces." One renderer, read in two directions. A separate match pattern is the defect of #997 written into the configuration schema |
The third row is the sharpest: patterns does not merely fail to implement the design, it encodes the very
divergence #997 exists to remove. A match regex and a replace template are two descriptions of one
header, and nothing makes them agree.
What #994 Phase 3 does with it
Replaces it. lint.copyright.header carries one Go template for the whole header; patterns is removed.
That is a breaking change to a declared field, which normally deserves a deprecation. It does not here, for a
reason worth stating plainly: the field has never done anything. No configuration can depend on behavior
that does not exist, and a star/config.yaml that sets patterns today is already being ignored. Removing it
changes no behavior; leaving it would keep a documented promise the code does not keep.
How it got here, which is the part worth not repeating
The manifest is the extension's declared interface, and nothing checks that the implementation reads what the
interface declares. patterns was designed, defaulted, documented and never wired up, and no gate noticed for
however long it has been there. enabled, license, holder and exclude are all read; patterns is the
one that is not, and it is indistinguishable from the others by inspection of the manifest alone.
Evidence of completion
-
patternsis removed fromCopyrightConfig's fields and defaults. -
lint.copyright.headerreplaces it: one Go template for the whole header, rendered by
pkg/op/provider/template'sRenderText, with the comment prefix applied per line by the linter. - A test asserts every field
CopyrightConfigdeclares is read by the implementation, so the next dead
field fails loudly. This is the general defect;patternsis one instance of it. - The removal is noted where a consumer would look, since the manifest documented the field.
Related documents
| Document | What it is |
|---|---|
| devlore-cli#994 | Phase 3 replaces this field; the rulings it contradicts are recorded on that plan |
| devlore-cli#997 | The checker-versus-fixer divergence that patterns' separate match regex would have made permanent |
| devlore-cli#999 | The other contradiction found the same hour: 22 of our files declare MIT and the linter cannot see them |
| extension.yaml | Where patterns is declared and defaulted |
| 9-star-extensions.md | Uses CopyrightConfig as its worked example, so it documents the dead field too |
Activity
David-Noble-at-work commentedon Oct 1, 2026
What replaces it, settled 2026-10-01
patternsis removed and two fields replace it, splitting the one thing it conflated.headeris the text, once, for every language. A literal -- no template fields at all, since the yearwould need a clock no provider exposes and a holder placeholder substitutes one configured string into another.
languagesis identification and comment syntax, which is the part that genuinely varies per file type.That is the correction to this issue's third objection.
patternscarried one template per language preciselybecause it mixed the text with the markers; separating them means a consumer writes one header and the
linter supplies
//or#from the file's type.The shape, and where it comes from
Measured against how others split the same problem:
extensions,filenames,filenamePatterns,firstLinelanguage-configuration.jsonwithlineComment,blockCommentHeaderTypeenum withfirstLine,beforeEachLine,endLine,skipLinePattern, two detection patternsVS Code's shape is adopted -- language-keyed, so everything about a file type sits together -- plus two fields
VS Code has no need for, because it only ever inserts a comment and never finds and replaces an existing
header:
skip-- the line the header must follow.^#!for a script;^#\s*syntax=for a Dockerfile, whoseparser directive stops being a directive if anything precedes it. The Linux kernel states the same rule
in prose, and
scripts/checkpatch.plis a live example: shebang on line 1, SPDX on line 2.detect-- matches a line of a header already present, which is what this issue'smatchregex wasreaching for. The difference is that
detectfinds what to replace whilematchdescribed what iscorrect, and only the second can disagree with
replace.first_lineis consulted only for a path with no extension, afterfilenames,filename_patternsandextensionsall fail. It reads the file, so that precedence is what keeps it to a handful of reads rather thanthe whole tree. It is not optional: 14 of Personal's shell scripts have no extension --
Build-DarwinInitializationPackage,Sync-CommonBuildTools,Install-UnixUserConfiguration-- andInstall-*is used there for both zsh and PowerShell, so no name pattern separates them. Line 1 does.The general defect this issue named, and it stands
enabled,license,holderandexcludewere read;patternswas not, and the manifest made themindistinguishable. A test asserting that every declared field is read is still the right acceptance, and it is
the part of this issue that outlives the field.
Note the ledger after this change:
licenseandholderare deleted rather than read, so the same testwould have to be written against the new field set --
enabled,header,languages,exclude.Tracked in #994's plan,
Requirements 3 and 5, Phases 3 and 5. The design documents are updated:
9-star-extensions.mdusesCopyrightConfigas its worked example and showed this field, andconfiguration.mdused it to illustrate!!maptag inference.doc: the header is configuration, the table describes file types, and…
feat(lint): the copyright header is configuration, and check compares…
David-Noble-at-work commentedon Nov 9, 2026
star github triage sweep added this issue to Triage: devlore, for the rule it breaks:
severity: a Bug whose Severity is blank; a bug is Critical, High, Medium or Low