Skip to content

sift 1.29.2 — the loop shapes nobody had checked

Choose a tag to compare

@jjba23 jjba23 released this 13 Nov 19:08
· 31 commits to trunk since this release
1fea9ed

Three things were left unpinned after 1.29.1: a dangling-style project, the
VS Code extension, and a loop clause whose body starts its own line. All three
are now checked against something rather than assumed.

A clause body on its own line was already right, in both dialects, and the
two engines that say so agree with sift column for column:

(loop for x in xs
      do
      (message "%s" x))

emacs-lisp-mode puts do and the forms after it in the column of for, and
cl-indent — what SLIME indents with — does the same for :do and :for. A
unit test in each dialect and a fixture pair for each corpus pin it, and the
expected files are editor output.

The dangling style keeps a loop's clauses in one column and its closer
aligned with the opener that opened it, and reformatting changes nothing. That
is a new fixture under tests/fixtures/elisp/dangling — the style was covered
for Scheme only.

The VS Code extension has no indentation of its own: "Format Document" runs
sift format --stdin, so it inherits the clauses rule from the executable and
handles a loop correctly by construction, with no change needed. It does not
pass --style and does not run with the document's directory as its working
directory, so a project that sets style: dangling or its own indent-rules in
sift.yaml is formatted with the defaults there. That is not fixed here; it
belongs in its own change, and the fix is one cwd rather than a second
setting.

And the guide stopped lying about an editor. It said Emacs indents a loop's
clauses two columns in when the opening line names none. It does not:
emacs-lisp-mode moves them one column in from the opener, cl-indent keeps
them under the column a first clause would have had, and a pcase with nothing
after it is four in. sift indents two columns in — one answer for every clause
list with no clause on its opening line, and a fixed point of its own
formatting — and the guide now says so instead of claiming agreement nobody
has.

No behaviour changes: formatting, linting and the language server answer exactly
what 1.29.1 answered.

Full Changelog: v1.29.1...v1.29.2