Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make ess style consistent with lintr config? #1261

Open
aramirezreyes opened this issue Aug 15, 2023 · 0 comments
Open

How to make ess style consistent with lintr config? #1261

aramirezreyes opened this issue Aug 15, 2023 · 0 comments

Comments

@aramirezreyes
Copy link

aramirezreyes commented Aug 15, 2023

HI! this is about the ESS with the R language.

Since ESS supports linting with lintr/flymake out of the box, it would be nice to have them agree on some criteria. This may be difficult to do automatically since lintr can be used out of the emacs/ESS context and thus they do not share configurations.

So I have in ~/.lintr

linters: linters_with_defaults(
    indentation_linter(indent = 2L),
  )
encoding: "UTF-8"

and in .emacs

(setq ess-style 'RStudio-)

With this configuration I get some discrepancies, especially in the indentations. For example, this code is indented by Emacs/ESS as:

log_model(sink_file, ordered, very, long, list, of, arguments
  variance, mean)

But it is flagged by the linter as:

[indentation_linter] Hanging indent should be 15 spaces but is 2 spaces.

So, maybe the Rstudio- and the default lintr (which I think follows the tidy verse style guide) are not fully equivalent, and that is completely okay. Then seems like I need to manually tweak my ESS style.
In the general case where one has modified the style of either ESS or linter, how can we make them consistent?

Is there a systematic way of translating versus .lintr configuration and ESS variables? Maybe a dictionary? Is there an automated way?

Thank you.

@aramirezreyes aramirezreyes changed the title How to make ess style consistent with lintr? How to make ess style consistent with lintr config? Aug 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant