Re: [ESS] ESS process on Docker containers and enabing Flymake

2022-01-05 Thread Gilchrist, Michael Aaron via ESS-help
To be clear, Alex is referring to the R package 'lintr', not an emacs
package.

I made that mistake and spent some time looking for an elpa package.

Mike
__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] ESS process on Docker containers and enabing Flymake

2020-02-22 Thread Martin Maechler via ESS-help
> Dirk Eddelbuettel via ESS-help 
> on Fri, 21 Feb 2020 15:01:32 -0600 writes:

> On 21 February 2020 at 12:50, Alex Branham wrote: | We do
> just use the package if it's installed. No demanding
> anywhere.

> Perfect, thanks for clarifying.

> Now, given that the package may at times be installed as a
> side-effect via the Depends: of another package, it might
> be worth considering if use should also require an opt-in
> in ~/.emacs.

That's where I agree with you, Dirk,  but typically the
majority of ESS core have disagreed saying they want new features
to be *on* by default, as they would not be seen and used enough
otherwise ... and that's a valid point of view (and matter of taste).

I think we should always have 3 to 4 (of 4) possibilities in
such  2 x 2 situations: 

  flymake_desired (yes/no)  x  lintr_installed (yes/no)

And one should often discuss / consider what happens in "the 4th case":

Here,
1) the user should have a simple customizable option to turn
   flymake on and off  (and AFAIK, we have that option)

2) "3 or 4 options": I'd vote for 3 here, in this sense:
  The first 3 options are obvious: if flymake is off, nothing is
  used (lintr there or not); if flymake is on and lintr is
  installed, things "get activated".
  
  4-th case however: If lintr is not installed and flymake is
  on, I think the user should get a not/message/warning  (once
  per session?) that flymake needs the CRAN R package lintr to
  work sensibly (and not try have flymake work "halfways" with
  code that is typically never used/tested by the developers themselves).
  But then *not* install it automatically -- I think differently in
  spirit than Rstudio which installs all kinds of crafts.. which
  is probably fine for Rstudio and its user base, but I think is
  not ok for ESS and its different user base) 

Martin

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] ESS process on Docker containers and enabing Flymake

2020-02-21 Thread Dirk Eddelbuettel via ESS-help


On 21 February 2020 at 12:50, Alex Branham wrote:
| We do just use the package if it's installed. No demanding anywhere.

Perfect, thanks for clarifying.

Now, given that the package may at times be installed as a side-effect via
the Depends: of another package, it might be worth considering if use should
also require an opt-in in ~/.emacs.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] ESS process on Docker containers and enabing Flymake

2020-02-21 Thread Alex Branham via ESS-help
We do just use the package if it's installed. No demanding anywhere.

Alex


On Thu, Feb 20, 2020, 9:36 PM Dirk Eddelbuettel  wrote:

>
> On 20 February 2020 at 17:51, Alex Branham via ESS-help wrote:
> | On Wed 19 Feb 2020 at 18:20, Shreyas Ragavan 
> wrote:
> |
> | >> You need to install the lintr package.
> | >
> | > So ESS actually needs the R package lintr installed to enable linting.
> | > It seems strange to me that I have to open R and install a package to
> | > get an 'IDE' functionality. Perhaps I am mistaken in my thinking.
> |
> | This is pretty standard behavior, I think. You'll find the same thing
> | with Rstudio, IIRC.
>
> There are many shades of grey possible between pitch black and white.
>
> One could just use the package if found installed. Demanding it to be
> present
> is quite a bit more strict, and I don't think I'd that.  But hey, your
> project, not mine.
>
> Dirk
>
> --
> http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
>

[[alternative HTML version deleted]]

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] ESS process on Docker containers and enabing Flymake

2020-02-20 Thread Dirk Eddelbuettel via ESS-help


On 20 February 2020 at 17:51, Alex Branham via ESS-help wrote:
| On Wed 19 Feb 2020 at 18:20, Shreyas Ragavan  wrote:
| 
| >> You need to install the lintr package.
| >
| > So ESS actually needs the R package lintr installed to enable linting.
| > It seems strange to me that I have to open R and install a package to
| > get an 'IDE' functionality. Perhaps I am mistaken in my thinking.
| 
| This is pretty standard behavior, I think. You'll find the same thing
| with Rstudio, IIRC.

There are many shades of grey possible between pitch black and white.

One could just use the package if found installed. Demanding it to be present
is quite a bit more strict, and I don't think I'd that.  But hey, your
project, not mine.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] ESS process on Docker containers and enabing Flymake

2020-02-20 Thread Alex Branham via ESS-help
On Wed 19 Feb 2020 at 18:20, Shreyas Ragavan  wrote:

>> You need to install the lintr package.
>
> So ESS actually needs the R package lintr installed to enable linting.
> It seems strange to me that I have to open R and install a package to
> get an 'IDE' functionality. Perhaps I am mistaken in my thinking.

This is pretty standard behavior, I think. You'll find the same thing
with Rstudio, IIRC.

> The elisp I'm using is below. I'm not sure if I need to set them to be TRUE 
> or something.
>
> (setq ess-use-flymake "lintr::with_defaults(
> "commas_linter",
> "commented_code_linter",
> "infix_spaces_linter",
> "line_length_linter",
> "object_length_linter",
> "object_name_linter",
> "object_usage_linter",
> "open_curly_linter",
> "pipe_continuation_linter",
> "single_quotes_linter",
> "spaces_inside_linter",
> "spaces_left_parentheses_linter",
> "trailing_blank_lines_linter",
> "trailing_whitespace_linter")")

You're not setting up the linters quite correctly. They need to look
like line_length_linter = line_length_linter(120). Their behavior is
documented --- start at ?lintr::with_defaults.

Alex

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] ESS process on Docker containers and enabing Flymake

2020-02-19 Thread Shreyas Ragavan via ESS-help
Alex,

Apologies for the delayed response on this and thank you for your feedback.

> You need to install the lintr package.

So ESS actually needs the R package lintr installed to enable linting. It seems 
strange to me that I have to open R and install a package to get an 'IDE' 
functionality. Perhaps I am mistaken in my thinking.

Is flymake or some form of syntax check usually not commonly employed by users 
of ESS? Perhaps due to lag in response? It does seem to be something useful to 
have, atleast during troubleshooting.

Anyway - apparently flymake was activated by installing the lintr package. Now 
I have flymake[0 0] in the modeline. Each time I type something there's a 
'wait', after which it returns to [0 0]. However, it does not catch any errors 
at all.

The elisp I'm using is below. I'm not sure if I need to set them to be TRUE or 
something.

(setq ess-use-flymake "lintr::with_defaults(
"commas_linter",
"commented_code_linter",
"infix_spaces_linter",
"line_length_linter",
"object_length_linter",
"object_name_linter",
"object_usage_linter",
"open_curly_linter",
"pipe_continuation_linter",
"single_quotes_linter",
"spaces_inside_linter",
"spaces_left_parentheses_linter",
"trailing_blank_lines_linter",
"trailing_whitespace_linter")")

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] ESS process on Docker containers and enabing Flymake

2020-01-25 Thread Alex Branham via ESS-help
On Thu 23 Jan 2020 at 14:09, Shreyas Ragavan via ESS-help 
 wrote:

> Dear All,
>
> I would be grateful for advice on 2 questions.
>
> 2. How can I enable flymake in ESS?
>
> Going through the documentation, I set the following and did not
> receive an error, but there is no indication of flymake working, and I
> think I have the syntax wrong. For example, I am able to create a
> variable name starting with a number and there is no error indication.
> So in my modeline - I can see flymake:!.
>
> (setq ess-use-flymake '("lintr::default_linters()"))
>
> (setq ess-use-flymake "lintr::default_linters()")
>
> Here are the 2 errors in the flymake logfile :
>
> Warning [flymake stock_analysis_completed.R]: Disabling backend 
> flymake-proc-legacy-flymake because (error Can’t find a suitable init 
> function)
> Error [ess-r-flymake  *ess-r-flymake*]: ‘lintr‘ package not installed

You need to install the lintr package.

Hope that helps,
Alex

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[ESS] ESS process on Docker containers and enabing Flymake

2020-01-23 Thread Shreyas Ragavan via ESS-help
Dear All,

I would be grateful for advice on 2 questions.

1. How to connect inferior modes / ESS processes to run on a specified docker 
container?

Within Org mode source blocks, I can use the :dir 
/docker:container-name/:/home/ header argument to run commands on docker 
containers and it seems to work well.

However, when I edit the source block C-c ' - and ESS has to connect to an R 
process - how can I have the process connected to the specified project docker 
container? Extending this - how about native .R files?

2. How can I enable flymake in ESS?

Going through the documentation, I set the following and did not receive an 
error, but there is no indication of flymake working, and I think I have the 
syntax wrong. For example, I am able to create a variable name starting with a 
number and there is no error indication. So in my modeline - I can see 
flymake:!.

(setq ess-use-flymake '("lintr::default_linters()"))

(setq ess-use-flymake "lintr::default_linters()")

Here are the 2 errors in the flymake logfile :

Warning [flymake stock_analysis_completed.R]: Disabling backend 
flymake-proc-legacy-flymake because (error Can’t find a suitable init function)
Error [ess-r-flymake  *ess-r-flymake*]: ‘lintr‘ package not installed


Warning [flymake *Org Src README.org[ R ]*]: Disabling backend 
ess-r-flymake because (wrong-type-argument sequencep 1)
Warning [flymake *Org Src README.org[ R ]*]: Disabling backend 
flymake-proc-legacy-flymake because (error Can’t find a suitable init function)

---

Some additional background may help with context for the docker question:

I have setup a bunch of docker images with a long list of common packages used 
in data science : https://github.com/shrysr/sr-ds-docker.

In a nutshell : there is an OS image, and then an image with R packages built 
on the OS image, and then separate rstudio server and shiny server images built 
on the R packages layer. This is actually a convenient starting point for 
anybody venturing in this direction. I would be happy for feedback, and it is a 
work in progress as always.

The shiny server works as expected. The idea is to standardise my working 
environment and have my data science projects to be reproducible. My current 
plan is to use a dedicated container for each individual project, and then 
extent these efforts into CI/CD and other things.

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help