• Login
Community
  • Login

PHP linter config with -l in Notepad++

Scheduled Pinned Locked Moved General Discussion
6 Posts 3 Posters 1.7k 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.
  • S
    Scott Moore
    last edited by May 29, 2022, 10:22 PM

    Did I miss something?
    For 2 years now, when writing code and after saving the php scripts with that code, I dig for particular folder full of a growing number of .bat file scripts each containing a windows command that runs php linter against the aforementioned PHP scripts to find PHP syntax errors --one script at a time -one syntax error at a time. The scripts take only a minute or two but after years it starts to annoy. Yes I searched and tried many suggestions but no dice. If I missed something plain to see just tell me. Funny thing is I had it working years ago. Can’t recall what I did.

    I tried configuring php linter using the plugin NppExec. No dice. The -l option prints a syntax error message the moment you type it, right? If you have it config’ed and working a screenshot with the precise config syntax would help.

    P S 2 Replies Last reply May 30, 2022, 12:06 AM Reply Quote 0
    • P
      PeterJones @Scott Moore
      last edited by May 30, 2022, 12:06 AM

      @scott-moore ,

      The -l option in Notepad++ just tells Notepad++ what language to use for syntax highlighting.

      NppExec can easily run an external linter on your active file. If you show your NppExec script, someone here can probably explain why it’s not doing what you want.

      1 Reply Last reply Reply Quote 0
      • S
        Scott Moore @Scott Moore
        last edited by Jun 7, 2022, 8:23 AM

        @scott-moore Thanks.

        1 Reply Last reply Reply Quote 0
        • S
          Scott Moore
          last edited by Jun 8, 2022, 12:04 AM

          Least Easy:
          A CMD script per php file DOS windows etc etc -see above post

          Easier:
          Now It is easier for me to lint (syntax check PHP using nppexec. Hit F6, smack a couple arrows keys then slam down the the Enter key and the error displays at the bottom of notepad++ Thx Peter. You didn’t have much detail but you implied it easy. IT was.

          EASIEST:
          I had php linter installed and configured in notepad++ years ago such that the instant you inserted a typo, php flashed the syntax error in the console at the bottom without having to save the file or punch a single button. Anybody know how I got that working.??

          ;)

          If not, how can I assign a single button to lint a php sciript? A trivial issue? After repeating a trivial task a million times it might annoy you.

          A 1 Reply Last reply Jun 8, 2022, 1:47 AM Reply Quote 0
          • A
            Alan Kilborn @Scott Moore
            last edited by Jun 8, 2022, 1:47 AM

            @scott-moore said in PHP linter config with -l in Notepad++:

            I had php linter installed and configured in notepad++ years ago such that the instant you inserted a typo, php flashed the syntax error in the console at the bottom without having to save the file or punch a single button.

            THAT seems ambitious. I’d think that unless something was super-highly integrated, that it would be taking a brute force method of linting the entire file on every keystroke/cut/paste/delete.

            I just have my Python syntax checker running on every save; no extra keystroke involved because saving often is good (and so is syntax checking). :-)

            Mine runs via a PythonScript using that plugin. You could consider that to invoke what you need, or if you’re not a big fan of Python, maybe the NppExec plugin meets your need better.

            S 1 Reply Last reply Jun 13, 2022, 8:29 PM Reply Quote 1
            • S
              Scott Moore @Alan Kilborn
              last edited by Jun 13, 2022, 8:29 PM

              @alan-kilborn Good advice. It’s good enough the way it is

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