Skip to content

Decode the marker shapes in one place - #2144

Merged
bbatsov merged 1 commit into
masterfrom
refactor/normalize-markers
Jul 29, 2026
Merged

Decode the marker shapes in one place#2144
bbatsov merged 1 commit into
masterfrom
refactor/normalize-markers

Conversation

@bbatsov

@bbatsov bbatsov commented Jul 29, 2026

Copy link
Copy Markdown
Owner

The internal debt this cycle created. A project type's marker specification
mixes two shapes - a bare file name and an (:any FILE...) clause - and each of
the four consumers took that apart for itself: detection, the :project-file
derivation, projectile-verify-files, and the doctor's renderer.

The derivation is the tell. It understood a clause only in the first position,
which is enough for every type registered today and wouldn't have been for the
next one. That's the kind of thing that works until someone writes
'("composer.json" (:any "bin/console" "app/console")) and wonders why the root
file seeding is wrong.

projectile--marker-clauses is now the one place that knows the shapes. It
answers with a list whose every element is a list of names, any one of which
satisfies that position, and returns nil for a predicate marker. The callers
stop asking what they were handed:

  • projectile-verify-files is an every-over-some with no shape test in it,
    while keeping its public contract of accepting the raw form.
  • the doctor joins alternatives with | and positions with a space, no
    any-marker-p in sight.
  • the derivation takes the first element whatever it contains.

No behaviour change. The old decoding was correct for the shapes that
actually reach it; this is about how many places know the shapes at all. The
public marker format and the stored plist are untouched, so anything reading
projectile-project-types sees exactly what it saw before - there's a spec that
walks every bundled type through the normalizer to confirm none of them changed
shape.

A marker specification mixes a bare file name with an (:any FILE...)
clause, and each of the four consumers took that apart for itself -
detection, the project-file derivation, verify-files and the doctor's
renderer. The derivation is the tell: it understood a clause only in the
first position, which happens to be enough for everything registered
today and would not have been for the next one.

projectile--marker-clauses now answers with a list whose every element
is a list of names, any one of which satisfies that position. Callers
stop asking what shape they were given: verify-files is an every-some
over it, the doctor joins alternatives with | and positions with a
space, and the derivation takes the first element whatever it contains.

No behaviour change - the old decoding was correct for the shapes that
reach it, this is about how many places know the shapes at all. The
public marker format and the stored plist are untouched.
@bbatsov
bbatsov merged commit 3ae0ce7 into master Jul 29, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant