R-nvim / R.nvim

Neovim plugin to edit R files
GNU General Public License v3.0
132 stars 15 forks source link

Fix selene warnings #21

Closed PMassicotte closed 5 months ago

PMassicotte commented 5 months ago

This should merge correctly now.

PMassicotte commented 5 months ago

What was the error you add with source_file? On my side it was working without having to create a tmp file.

jalvesaq commented 5 months ago

I'm not at home now. I will look this later.

jalvesaq commented 5 months ago

Checking out commit 7587ebea50bd3b3d744b28a71eebc54f610b3f38 I get after <LocalLeader>aa:

E5108: Error executing lua tmp-R-Nvim/lua/r/term.lua:22: attempt to concatenate local 'command' (a table value)
stack traceback:
        tmp-R-Nvim/lua/r/term.lua:22: in function 'cmd'
        tmp-R-Nvim/lua/r/send.lua:116: in function 'source_file'
        [string ":lua"]:1: in main chunk
jalvesaq commented 5 months ago

Moreover, in the distant past, we have had problems sending big chunks of code to R Console. This is the origin of the source commands.

jalvesaq commented 5 months ago

The Github button to merge the pull request is disabled because the code is failing selene tests. Trying Github instructions to merge manually, I get:

Switched to branch 'main'
Your branch is up to date with 'origin/main'.
Merge made by the 'ort' strategy.
 .github/workflows/selene.yml |  1 -
 lua/r/job.lua                | 81 ++++++++++++++++++++++++++++++++++++---------------------------------------------
 lua/r/send.lua               |  2 +-
 selene.toml                  |  7 ++++---
 tests/r/utils_spec.lua       |  5 +++--
 5 files changed, 44 insertions(+), 52 deletions(-)
Enumerating objects: 66, done.
Counting objects: 100% (58/58), done.
Delta compression using up to 8 threads
Compressing objects: 100% (37/37), done.
Writing objects: 100% (40/40), 4.67 KiB | 1.17 MiB/s, done.
Total 40 (delta 22), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (22/22), completed with 9 local objects.
To https://github.com/jalvesaq/tmp-R-Nvim
 ! [remote rejected] main -> main (refusing to allow a Personal Access Token to create or update workflow `.github/workflows/selene.yml` without `workflow` scope)
error: failed to push some refs to 'https://github.com/jalvesaq/tmp-R-Nvim'
jalvesaq commented 5 months ago

It worked, I guess.

jalvesaq commented 5 months ago

We have this in selene.toml: std="lua52+vim". However, according to Neovim's documentation (luaref.txt), Lua's version is 5.1.

Also, we can delete the rule parse_error = "allow" because I eliminated the goto statement.

PMassicotte commented 5 months ago

Just made the changes.

jalvesaq commented 5 months ago

Thanks!