From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [RFC] Org linting library Date: Tue, 19 May 2015 15:32:32 +0200 Message-ID: References: <87a8y4fdmv.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yuhdg-0007zb-1a for emacs-orgmode@gnu.org; Tue, 19 May 2015 09:33:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuhdM-0005RP-B0 for emacs-orgmode@gnu.org; Tue, 19 May 2015 09:32:55 -0400 Received: from mail-wg0-f51.google.com ([74.125.82.51]:33642) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuhdM-0005Qu-3J for emacs-orgmode@gnu.org; Tue, 19 May 2015 09:32:36 -0400 Received: by wgjc11 with SMTP id c11so18166920wgj.0 for ; Tue, 19 May 2015 06:32:35 -0700 (PDT) Received: from Rainers-MacBook-Pro.local (arn78-1-88-186-171-7.fbx.proxad.net. [88.186.171.7]) by mx.google.com with ESMTPSA id o6sm17392891wiz.24.2015.05.19.06.32.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 May 2015 06:32:34 -0700 (PDT) In-Reply-To: <87a8y4fdmv.fsf@nicolasgoaziou.fr> (Nicolas Goaziou's message of "Sun, 19 Apr 2015 15:31:36 +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: Org Mode List --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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. > This sounds very interesting and I would like to try it out. I understand that it can't be put into master, but could it be put into a branch? This would make testing a bit easier. Thanks, Rainer > Feedback welcome. > > > Regards, =2D-=20 Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,= UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug PGP: 0x0F52F982 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) iQEcBAEBAgAGBQJVWztwAAoJENvXNx4PUvmCDewH/2fFYIy3b/SXNCvLFm045jQq ngIvvn59jiUlB7hVeBojvDgvEPBe8IIASEMouqOHGFIB2HGiGW4ztUGi8YnLzzhD PzkexQkoI0jJ3K5Q43zCGW84vhX06wVYgCGagQsf+jmdDtE+Vm406y1+3pSEyA6l jF135gDym3w5SMv0ttrMEnlBroRfBS4QhsaAk3IVcEuFqHbN0syn5Ahrkc1ayu3I jvGRpVxXZ5rWZmTvO9HsP8qq2HQllrHRkuJNZAimnpDYPIz2fxRp5Ch9SYQZrK5V 25Y2M6ITp7qrvnqC/PJTOT4g8DuI42IOnHiTb+haw6XprUP8mPFZa+Mm8PSdc2g= =omu5 -----END PGP SIGNATURE----- --=-=-=--