SvEx.Plugin.Classify (SvEx v0.4.2)

Decides what a hunk means (SDD 7.3).

A hunk is APPENDABLE — :contributes — only if it both parses as standalone Elixir and begins at column 0. Parsing alone is not enough: import Foo and alias Foo parse perfectly well but must live inside a module, and appending either to the end of a file produces code that does not compile.

Everything else is :manual: shipped verbatim and applied as conflict markers, because there is no safe automatic placement for an insertion inside an existing expression.

Summary

Functions

The bucket for a hunk of added lines.

An idempotency key for a keyed entry, unique within the plugin.

Functions

bucket(lines, path)

@spec bucket([binary()], Path.t()) :: :contributes | :manual

The bucket for a hunk of added lines.

path selects the test: only Elixir source can be parsed, so every other extension defaults to :contributes, matching 7.1's compose.yaml and assets/js/app.js entries.

key(plugin, path, taken)

@spec key(atom(), Path.t(), [atom()]) :: atom()

An idempotency key for a keyed entry, unique within the plugin.

taken is the keys already assigned; a collision gets a numeric suffix.