* lisp/align.el (align-rules-list): Add rule for conf-toml-mode.
* test/lisp/align-resources/conf-toml-mode.erts: New file.
* test/lisp/align-tests.el (align-toml): New test.
(css-declaration
(regexp . "^\\s-*\\(?:\\w-?\\)+:\\(\\s-*\\).*;")
(group . (1))
- (modes . '(css-mode html-mode))))
+ (modes . '(css-mode html-mode)))
+
+ (toml-assignment
+ (regexp . ,(rx (group (zero-or-more (syntax whitespace)))
+ "="
+ (group (zero-or-more (syntax whitespace)))))
+ (group . (1 2))
+ (modes . '(conf-toml-mode))))
"A list describing all of the available alignment rules.
The format is:
--- /dev/null
+Name: align key-value pairs
+
+=-=
+[foo]
+foo1=10
+foo22=20
+
+[bar]
+bar333="example.org"
+bar4444 = "zzz"
+=-=
+[foo]
+foo1 = 10
+foo22 = 20
+
+[bar]
+bar333 = "example.org"
+bar4444 = "zzz"
+=-=-=
+
+Name: align list values
+
+=-=
+[foo]
+a = 1
+some_list = [
+ true,
+ false,
+]
+some_other_list = [
+ 1,
+ 2,
+]
+=-=
+[foo]
+a = 1
+some_list = [
+ true,
+ false,
+]
+some_other_list = [
+ 1,
+ 2,
+]
+=-=-=
(ert-test-erts-file (ert-resource-file "java-mode.erts")
(test-align-transform-fun #'java-mode)))
+(ert-deftest align-toml ()
+ (let ((indent-tabs-mode nil))
+ (ert-test-erts-file (ert-resource-file "conf-toml-mode.erts")
+ (test-align-transform-fun #'conf-toml-mode))))
+
(provide 'align-tests)
;;; align-tests.el ends here