Check the indentation of the sources on CI - #149
Merged
Merged
Conversation
Mirrors the config we use in CIDER.
Disable the line-length rule, which doesn't fit a changelog with one-line entries.
Most of it was spec bodies sitting a couple of columns off from where
Emacs would put them, which is easy to do by hand and easy to copy into
the next spec.
The font-lock spec tables needed a bit more than whitespace: entries
like
("#_foo" ("#_" font-lock-comment-delimiter-face)
("foo" font-lock-comment-face))
only line up if you align them yourself, and Emacs wants to put the
continuation one column in from the open paren, which reads terribly for
a table of expectations. Moving the input to its own line gives the same
layout and Emacs agrees with it.
Claude-Session: https://claude.ai/code/session_01WFsEgHWFYxaACMvodJqz2z
Adds `eldev indent`, which reindents every Emacs Lisp source file and reports the lines that come out different, plus `eldev indent --fix` to rewrite them. `make indent` runs it and the lint job calls that. The catch is that indentation of a macro call comes from the `declare` form of the macro, so buttercup and the whole test suite have to be loaded before anything is checked. Without them `describe', `it' and the helpers in test-helper.el fall back to the default function indentation and practically every spec looks misindented. Blank lines and lone semicolon comments are left alone. Emacs aligns the latter to `comment-column', which would push a stray `; TODO' out to column 40 and is not worth policing. Claude-Session: https://claude.ai/code/session_01WFsEgHWFYxaACMvodJqz2z
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
eldev indent, which reindents every Emacs Lisp source file and reports the lines that come out different (--fixrewrites them).make indentwraps it and the lint job runs that.The fiddly part: a macro call's indentation comes from the
declareform of the macro, so buttercup and the whole test suite have to be loaded before anything is checked, ordescribe,itand the test-helper macros fall back to default function indentation and every spec looks misindented. Blank lines and lone semicolon comments are exempt too, since Emacs aligns the latter tocomment-columnand a stray; TODOwould get "fixed" out to column 40.The reindent commit is the fallout. The font-lock spec tables needed a small restructure rather than plain whitespace: their entries only lined up because someone aligned them by hand, and Emacs wants the continuation one column in from the open paren, which reads badly for a table of expectations. Moving the input to its own line keeps the layout and makes Emacs agree.