Community
    • Login

    shellcheck plugin wanted

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    10 Posts 4 Posters 5.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Gerhardus ScheltemaG
      Gerhardus Scheltema
      last edited by

      Not sure if this is the correct place, I have been using Notepad++ for years, currently using 64bit version. I love using Notepad++ for bash scripting, some other heavier and not so elegant text IDEs have support for shellcheck but Notepad++ is still lacking.

      I’m not a developer, could somebody please create a plugin to support shellcheck?

      1 Reply Last reply Reply Quote 1
      • Michael VincentM
        Michael Vincent
        last edited by

        DSpellCheck doesn’t fit the bill?

        1 Reply Last reply Reply Quote 1
        • PeterJonesP
          PeterJones
          last edited by

          @Gerhardus-Scheltema ,

          Clarification please: I interpreted your question as a question about “spell check” (and based on the contents of the previous reply, I’m not the only one).

          But on re-reading, with the mention of “bash scripting”: is “shellcheck” some sort of utility for helping with authoring of shell scripts, like bash scripts – and you’d like a plugin that integrated the shellcheck results into Notepad++? Or was it, as I originally thought, just a misspelling of “spellcheck”?

          1 Reply Last reply Reply Quote 0
          • Alan KilbornA
            Alan Kilborn
            last edited by

            Probably “shellcheck” is correct, as there’s one for vim: https://github.com/koalaman/shellcheck

            1 Reply Last reply Reply Quote 1
            • PeterJonesP
              PeterJones
              last edited by PeterJones

              @Alan-Kilborn said:

              Probably “shellcheck” is correct, as there’s one for vim

              Interesting. I learned recently that you can teach NppExec to interpret the output of an external command, like linters or other code checkers, and make it interact with Notepad++.

              Since Michael seemed familiar with that feature, if @Gerhardus-Scheltema can supply example output of the shellcheck, it might be possible to use it in conjunction with NppExec to do enough of what the OP wants, without a dedicated plugin. If it’s not a separate executable, but was built into that vim plugin/extension, it will be less likely to make it work easily.

              (That said, the straight answer to the OP is "no, I don’t know of any shellcheck plugin for Notepad++, and it doesn’t seem to be in the Plugins Admin list.)

              1 Reply Last reply Reply Quote 1
              • Michael VincentM
                Michael Vincent
                last edited by

                LOL, sorry, I completely misread that post.

                1 Reply Last reply Reply Quote 1
                • Gerhardus ScheltemaG
                  Gerhardus Scheltema
                  last edited by

                  Looking into NppExec now, I already have the windows binary in my path. Shellcheck already returns json that indicates the position of the problem, having that directly in your edit window would be fantastic.

                  1 Reply Last reply Reply Quote 0
                  • Gerhardus ScheltemaG
                    Gerhardus Scheltema
                    last edited by

                    Fantastic, this is already much better, I have done this:

                    1. Install NppExec plugin
                    2. Plugins -> NppExec -> Run (F6)
                    3. use this command: “shellcheck.exe -f gcc $(FULL_CURRENT_PATH)” # Note that shellcheck binary already in path
                      or just use “shellcheck.exe $(FULL_CURRENT_PATH)” also works
                      Optional:
                    4. Shift-F6 and add “%FILE%:%LINE%:%CHAR%” make it highlight red.

                    I open my files directly from WinScp the only problem is that you have to save the file, I’m usually very careful with my scripts anyway and work directly on test server, but it would be great if I can get it to save to temporary file run the linting show output and then I can make changes and save the file separately.

                    1 Reply Last reply Reply Quote 4
                    • Michael VincentM
                      Michael Vincent
                      last edited by

                      Are you editing a file on a remote server by WinScp locally, changes and the re-upload? Look at NppFTP, it does scp as well. I use it all the time to edit files that are local to Linux from my Windows / N++.

                      Cheers.

                      1 Reply Last reply Reply Quote 2
                      • Gerhardus ScheltemaG
                        Gerhardus Scheltema
                        last edited by

                        NppFTP is a very good tool, but still does not support scp properly, and using public/private key authentication is still a struggle, or at least I cant get it to work. I use it at home for certain servers, but at work I prefer WinSCP and NPP when not using vim.

                        I hope this thread will inspire some plugin developer to integrate shellcheck into a plugin, have some kind of line highlighting or popup/tooltip type popup showing the output of shellcheck validation, maybe even a autoreplace text, which needs to be used with care :-)

                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors