From: Andreas Leha <andreas.leha@med.uni-goettingen.de>
To: emacs-orgmode@gnu.org
Subject: Re: [RFC] Org linting library
Date: Wed, 20 May 2015 21:42:19 +0100 [thread overview]
Message-ID: <oluiobnhtg4.fsf@med.uni-goettingen.de> (raw)
In-Reply-To: m2oalfl1a1.fsf@krugs.de
Hi Rainer,
Rainer M Krug <Rainer@krugs.de> writes:
> Rainer M Krug <Rainer@krugs.de> writes:
>
>> Rainer M Krug <Rainer@krugs.de> writes:
>>
>>> Andreas Leha <andreas.leha@med.uni-goettingen.de> writes:
>>>
>>>> Hi Rainer,
>>>>
>>>> Rainer M Krug <Rainer@krugs.de> writes:
>>>>> Nicolas Goaziou <mail@nicolasgoaziou.fr> 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.
>>>>>
>>>>
>>>> It is. The branch is called `wip-lint'.
>>>
>>> Thanks (also to Nicolas) - I found it. Just expected the branch to be
>>> tracked automatically.
>>>
>>> This is really brilliant!
>>>
>>> But I now get a message in one .org file:
>>>
>>> ,----
>>> | Org linting process starting...
>>> | Search failed: "^[ ]*#\\+NAME: +tab:sensVar"
>>> `----
>>>
>>> and no results.
>>>
>>> Works in other .org files.
>>>
>>> This one is rather long (11570 lines) and many code blocks.
>>>
>>> Just let me know how I can trace down where this is coming from and what
>>> the message tells me.
>>
>> It seems that the error comes from the fact that ~#+LABEL: sensVar~ was
>> defined twice.
>>
>> Renaming these results in working linting.
>
> OK - please ignore this last comment.
>
> There is an example where I get the error:
>
> * Fitting the kernel to the data
> The parameter which will be fitted can be found in Table [[tab:fitInitial]]
>
> #+CAPTION: Variables used for the initial fit of the wind profile using the function and the initial values.
> #+LABEL: tab:fitInitial
> | variable | initial value | remark |
> |--------------------+---------------+--------------------------------------------------|
>
> The cause is the link [[tab:initial]] If I remove everything below and
> including the line #+CAPTION the linting works.
>
> ,----
> | 2 high Unknown fuzzy location "tab:fitInitial"
> `----
>
Untested - but should that not be
#+NAME: tab:fitInitial
rather than #+LABEL?
Cheers,
Andreas
next prev parent reply other threads:[~2015-05-20 20:41 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-19 13:31 [RFC] Org linting library Nicolas Goaziou
2015-04-19 14:23 ` Rasmus
2015-04-19 16:24 ` Nicolas Goaziou
2015-04-19 19:32 ` Marco Wahl
2015-04-20 10:42 ` Nicolas Goaziou
2015-04-20 2:15 ` Charles C. Berry
2015-04-20 9:12 ` Nicolas Goaziou
2015-04-22 19:27 ` Nicolas Goaziou
2015-04-22 19:31 ` Sebastien Vauban
2015-04-22 19:40 ` Nicolas Goaziou
2015-04-23 10:47 ` Eric Abrahamsen
2015-04-23 16:25 ` Sebastien Vauban
2015-04-26 12:50 ` Nicolas Goaziou
2015-04-27 15:22 ` Doug Lewan
2015-05-19 11:54 ` Andreas Leha
2015-05-19 13:39 ` Nicolas Goaziou
2015-05-19 14:54 ` Andreas Leha
2015-05-19 19:09 ` Nicolas Goaziou
2015-05-19 20:02 ` Andreas Leha
2015-05-19 21:03 ` Nicolas Goaziou
2015-05-19 21:10 ` Andreas Leha
2015-05-19 21:26 ` Nicolas Goaziou
2015-05-19 21:35 ` Andreas Leha
2015-05-19 13:32 ` Rainer M Krug
2015-05-19 13:43 ` Andreas Leha
2015-05-20 15:01 ` Rainer M Krug
2015-05-20 15:08 ` Rainer M Krug
2015-05-20 15:24 ` Rainer M Krug
2015-05-20 20:42 ` Andreas Leha [this message]
2015-05-20 21:15 ` Rainer M Krug
2015-05-20 21:46 ` Nicolas Goaziou
2015-05-21 8:40 ` Rainer M Krug
2015-05-21 16:24 ` Nicolas Goaziou
2015-05-21 18:18 ` Rainer M Krug
2015-05-21 18:23 ` Rainer M Krug
2015-05-21 18:30 ` Rainer M Krug
2015-05-21 21:53 ` Nicolas Goaziou
2015-05-22 8:10 ` Rainer M Krug
2015-05-22 19:08 ` Nicolas Goaziou
2015-05-23 12:00 ` Rainer M Krug
2015-05-24 15:19 ` Nicolas Goaziou
2015-05-24 15:52 ` Rainer M Krug
2015-05-27 9:31 ` Andreas Leha
2015-05-27 10:49 ` Nicolas Goaziou
2015-05-19 13:47 ` Nicolas Goaziou
2015-06-05 10:51 ` Rainer M Krug
2015-06-05 21:40 ` Nicolas Goaziou
2015-06-06 14:44 ` Rainer M Krug
2015-06-06 23:22 ` Nicolas Goaziou
2015-06-08 7:50 ` Rainer M Krug
2015-06-09 7:30 ` Nicolas Goaziou
2015-06-09 7:50 ` Rainer M Krug
2015-06-16 21:54 ` Nicolas Goaziou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=oluiobnhtg4.fsf@med.uni-goettingen.de \
--to=andreas.leha@med.uni-goettingen.de \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.