[ESS] lintr and flyspell

Martin Maechler maechler at lynne.stat.math.ethz.ch
Thu Apr 9 12:30:27 CEST 2015


>>>>> Charles C Berry <ccberry at ucsd.edu>
>>>>>     on Tue, 7 Apr 2015 09:35:28 -0700 writes:

    > On Mon, 6 Apr 2015, Stephen Eglen wrote:
    >> Anyone been using lintr package for lint-checking of R code?  Its now
    >> integrated into flycheck:
    >> 
    >> https://github.com/jimhester/lintr
    >> http://www.flycheck.org/2015/04/06/flycheck-0.23.html
    >> 
    >> I've not tried it out yet - has anyone?

    > I have used the emacs flycheck part on ESS R buffers.

    > And it seemed to work as advertised. No hangs or crashes that I recall. 
    > I've mostly used it on smallish ESS *.R buffers. I recall longer buffers 
    > took a while to check, but IIRC this was not an issue - I could navigate 
    > elsewhere to work.

    > However, I unplugged flycheck recently.

    > The out-of-the-box settings in lintr were not pleasing to me.

    > See the screenshots on the lintr page above for some examples of what the 
    > settings are.

    > Maybe when I get some time I'll revise them more to my liking and plug it 
    > back in.

    > I did not notice where/whether customizations are/can be done.

    > Does anyone have a pointer to easy customization of lintr?

    > Chuck

Very good question.  Such customization would be a minimal
requirement for me to use it personally.


My 2014 (last year)'s useR! plenary talk 
   "Good Practices in R Programming"
   (e.g. from here http://stat.ethz.ch/Teaching/maechler/R/useR_2014/)

tried to emphasize (among too many other things) that good programming
style includes consistency, and at least orally I did mention style guides,
*but* that good style by an expert human is clearly superior to any
blindly enforced rules, in the same way that good programming is not only
something you do by rules, but is partly an art.

In addition: R stands on the shoulders of S and a long very successful
history which unfortunately includes inconsistent (function, variable,
argument, ..) names that have belonged the language "forever".

So, I would hate that a specific style guide is used (as in lintr) to
define what is undesirable style and even prevent me doing better than
a machine-enforced ruleset.

Martin



More information about the ESS-help mailing list