Hello,

Yasushi SHOJI <yasushi.sh...@gmail.com> writes:

> How about using org-lint or some other formatter on git commit hook?
> after go lang introduced gofmt, many projects adapted the method to
> keep the code constant.

Org Lint is not a formatter. It detects common mistakes or hypothetical
mistakes in an Org document, e.g., invalid links. In particular, it
doesn't detect stylistic issues like those discussed above.

It doesn't mean we couldn't run it automatically. However, it also emits
warnings (see `trust' property) on perfectly valid syntax.

As a side note, writing an Org formatter is trivial:

    (when (yes-or-no-p "Really format current buffer ? ")
      (let ((document (org-element-interpret-data (org-element-parse-buffer))))
        (erase-buffer)
        (insert document)
        (goto-char (point-min))))

Regards,

-- 
Nicolas Goaziou

Reply via email to