From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: [RFC] Org linting library Date: Tue, 19 May 2015 12:54:34 +0100 Message-ID: References: <87a8y4fdmv.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yug6H-0000nn-RX for emacs-orgmode@gnu.org; Tue, 19 May 2015 07:54:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yug6D-0002v5-QP for emacs-orgmode@gnu.org; Tue, 19 May 2015 07:54:21 -0400 Received: from plane.gmane.org ([80.91.229.3]:45535) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yug6D-0002uz-JV for emacs-orgmode@gnu.org; Tue, 19 May 2015 07:54:17 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Yug69-00023E-8R for emacs-orgmode@gnu.org; Tue, 19 May 2015 13:54:13 +0200 Received: from 193.63.223.67 ([193.63.223.67]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 19 May 2015 13:54:13 +0200 Received: from andreas.leha by 193.63.223.67 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 19 May 2015 13:54:13 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Nicolas Goaziou writes: > Hello, > > The following library implements linting for Org syntax. The sole public > function is `org-lint', which see. > > Internally, the library defines a new structure: `org-lint-checker', > with the following slots: > > - NAME: Unique check identifier, as a symbol. The check is done > calling the function `org-lint-NAME' with one mandatory argument, > the parse tree describing the current Org buffer. Such function > calls are wrapped within a `save-excursion' and point is always at > `point-min'. Its return value has to be an alist (POSITION MESSAGE) > when POSITION refer to the buffer position of the error, as an > integer, and MESSAGE is a strings describing the error. > > - DESCRIPTION: Summary about the check, as a string. > > - CATEGORIES: Categories relative to the check, as a list of symbol. > They are used for filtering when calling `org-lint'. Checkers not > explicitly associated to a category are collected in the `default' > one. > > - TRUST: The trust level one can have in the check. It is either `low' > or `high', depending on the heuristics implemented and the nature of > the check. This has an indicative value only and is displayed along > reports. > > All checks have to be listed in `org-lint--checkers'. > > Results are displayed in a special "*Org Lint*" buffer with a dedicated > major mode, derived from `tabulated-list-mode'. In addition to the usual > key-bindings inherited from it, "C-j" displays problematic line reported > under point and "RET" jumps to it. > > Checks currently implemented are: > > - duplicates CUSTOM_ID properties > - duplicate NAME values > - duplicate targets > - duplicate footnote definitions > - orphaned affiliated keywords > - obsolete affiliated keywords > - missing language in src blocks > - NAME values with a colon > - wrong header arguments in src blocks > - misuse of CATEGORY keyword > - "coderef" links with unknown destination > - "custom-id" links with unknown destination > - "fuzzy" links with unknown destination > - "id" links with unknown destination > - links to non-existent local files > - special properties in properties drawer > - obsolete syntax for PROPERTIES drawers > - missing definition for footnote references > - missing reference for footnote definitions > - non-footnote definitions in footnote section > - probable invalid keywords > - invalid blocks > - probable incomplete drawers > - obsolete QUOTE section > > Since it relies on lexical binding, `pcase' and `string-prefix-p', it > cannot be added to Org 8.3, but can make it into Org 8.4, if deemed > useful enough. > > Feedback welcome. > > > Regards, Hi Nicolas, I have finally made some time to test this. I get some unexpected warnings: 79 low Unknown value "myfile.R" for header ":tangle" 192 low Unknown value "none" for header ":results" 22985 low Unknown value "never-export" for header ":eval" Thanks for this very useful tool! Thanks, Andreas