Skip to content

Commit

Permalink
Merge pull request #17 from PMassicotte/luacheck-action
Browse files Browse the repository at this point in the history
Github actions using the selene linter
  • Loading branch information
jalvesaq authored Feb 7, 2024
2 parents 4ba8625 + 29f4372 commit 3117dc5
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 36 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/selene.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# https://github.com/Kampfkarren/selene/issues/284
name: lintcheck
on: [push, pull_request]
jobs:
sile:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: selene linter
uses: NTBBloodbath/[email protected]
with:
# Github secret token
token: ${{ secrets.GITHUB_TOKEN }}
# selene arguments
args: . --config selene.toml
version: 0.26.1
68 changes: 32 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,41 +34,38 @@ Example of configuration for `lazy.nvim`:

The complete list of options is in the documentation.


## Usage

Please read the plugin's
[documentation](https://github.com/jamespeapen/Nvim-R/wiki) for instructions on
[usage](https://github.com/jamespeapen/Nvim-R/wiki/Use).



## Screenshots

The animated GIF below shows R running in a [Neovim] terminal buffer. We can
note:

1. The editor has some code to load Afrobarometer data on Mozambique, R is
running below the editor and the Object Browser is on the right side. On
the R Console, we can see messages inform some packages were loaded. The
messages are in magenta because they were colorized by the package
[colorout].
1. The editor has some code to load Afrobarometer data on Mozambique, R is
running below the editor and the Object Browser is on the right side. On
the R Console, we can see messages inform some packages were loaded. The
messages are in magenta because they were colorized by the package
[colorout].

2. When the command `library("foreign")` is sent to R, the string *read.spss*
turns blue because it is immediately recognized as a loaded function
(the Vim color scheme used is [southernlights]).
2. When the command `library("foreign")` is sent to R, the string _read.spss_
turns blue because it is immediately recognized as a loaded function
(the Vim color scheme used is [southernlights]).

3. When Mozambique's `data.frame` is created, it is automatically displayed
in the Object Browser. Messages about unrecognized types are in magenta
because they were sent to *stderr*, and the line *Warning messages* is in
red because colorout recognized it as a warning.
3. When Mozambique's `data.frame` is created, it is automatically displayed
in the Object Browser. Messages about unrecognized types are in magenta
because they were sent to _stderr_, and the line _Warning messages_ is in
red because colorout recognized it as a warning.

4. When the "label" attributes are applied to the `data.frame` elements, the
labels show up in the Object Browser.
4. When the "label" attributes are applied to the `data.frame` elements, the
labels show up in the Object Browser.

5. The next images show results of omni completion.
5. The next images show results of omni completion.

6. The last slide shows the output of `summary`.
6. The last slide shows the output of `summary`.

![Nvim-R screenshots](https://raw.githubusercontent.com/jalvesaq/Nvim-R/master/Nvim-R.gif "Nvim-R screenshots")

Expand All @@ -81,21 +78,21 @@ The black arrow represents all commands that you trigger in the editor and
that you can see being pasted into R Console.
There are three different ways of sending the commands to R Console:

- When running R in a Neovim built-in terminal, the function `chansend()`
is used to send code to R Console.
- When running R in a Neovim built-in terminal, the function `chansend()`
is used to send code to R Console.

- When running R in an external terminal emulator, Tmux is used to send
commands to R Console.
- When running R in an external terminal emulator, Tmux is used to send
commands to R Console.

- On the Windows operating system, Nvim-R can send a message to R (nvimcom)
which forwards the command to R Console.
- On the Windows operating system, Nvim-R can send a message to R (nvimcom)
which forwards the command to R Console.

The R package *nvimcom* includes the application *nvimrserver* which is never
The R package _nvimcom_ includes the application _nvimrserver_ which is never
used by R itself, but is run as a Vim/Neovim's job. That is, the communication
between the *nvimrserver* and Vim/Neovim is through the *nvimrserver* standard
input and output (green arrows). The *nvimrserver* application runs a TCP
server. When *nvimcom* is loaded, it immediately starts a TCP client that
connects to *nvimrserver* (red arrows).
between the _nvimrserver_ and Vim/Neovim is through the _nvimrserver_ standard
input and output (green arrows). The _nvimrserver_ application runs a TCP
server. When _nvimcom_ is loaded, it immediately starts a TCP client that
connects to _nvimrserver_ (red arrows).

Some commands that you trigger are not pasted into R Console and do not output
anything in R Console; their results are seen in the editor itself. These are
Expand All @@ -108,19 +105,18 @@ When new objects are created or new libraries are loaded, nvimcom sends
messages that tell the editor to update the Object Browser, update the syntax
highlight to include newly loaded libraries and open the PDF output after
knitting an Rnoweb file and compiling the LaTeX result. Most of the
information is transmitted through the TCP connection to the *nvimrserver*,
information is transmitted through the TCP connection to the _nvimrserver_,
but temporary files are used in a few cases.


## See also:

- [cmp-r](https://github.com/R.nvim/cmp-r): [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) source using Nvim-R as backend.
- [cmp-r](https://github.com/R.nvim/cmp-r): [nvim-cmp](https://github.com/hrsh7th/nvim-cmp) source using Nvim-R as backend.

- [languageserver](https://cran.r-project.org/web/packages/languageserver/index.html): a language server for R.
- [languageserver](https://cran.r-project.org/web/packages/languageserver/index.html): a language server for R.

- [colorout](https://github.com/jalvesaq/colorout): a package to colorize R's output.
- [colorout](https://github.com/jalvesaq/colorout): a package to colorize R's output.

- [R-Vim-runtime](https://github.com/jalvesaq/R-Vim-runtime): development version of some Vim runtime files for R.
- [R-Vim-runtime](https://github.com/jalvesaq/R-Vim-runtime): development version of some Vim runtime files for R.

[Neovim]: https://github.com/neovim/neovim
[southernlights]: https://github.com/jalvesaq/southernlights
Expand Down

0 comments on commit 3117dc5

Please sign in to comment.