Code Monkey home page Code Monkey logo

Comments (17)

w0rp avatar w0rp commented on May 16, 2024 1

@scwood I think I finally figured out what was going on. I tried the PHP linter on a friend's machine, and it was outputting the errors to stdout, whereas my machine outputs them to stderr. I added support to the plugin for reading from both streams, so it will just pick up all lines of output and parse them. This might be one of those things you can change in php.ini. Let me know if it works for you now.

from ale.

w0rp avatar w0rp commented on May 16, 2024

Hmm, the problem here isn't obvious to me yet. I might have a go at adding this to the repo myself and credit you as the author. It looks okay, so it's probably some minor bug.

from ale.

scwood avatar scwood commented on May 16, 2024

Okay, let me know if there's something that needs to be changed. I would like to keep contributing. Great plugin.

from ale.

w0rp avatar w0rp commented on May 16, 2024

I have pushed your code now with some minor changes. php needed -- instead of - to read from stdin, which is a bit odd, but it works. The second error was that the regex matches start at index 1, and not 0. That's a common mistake, which I didn't notice until I started playing around with it.

from ale.

scwood avatar scwood commented on May 16, 2024

Thanks for explaining those changes. I have the latest code, but I'm still
not seeing any linting feedback in my buffer.

Here's the code I'm using:

<?php
echo "Hello!" // this needs a semi-colon

I have pushed your code now with some minor changes. php needed --
instead of - to read from stdin, which is a bit odd, but it works. The
second error was that the regex matches start at index 1, and not 0.
That's a common mistake, which I didn't notice until I started playing
around with it.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#37 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AItA-uQz2tUR1g2lsaqevcls4XOqXFraks5qwY10gaJpZM4KNHXm
.

from ale.

w0rp avatar w0rp commented on May 16, 2024

Ah, there is one bug left to be fixed which I can fix tomorrow. Some errors go one line beyond the last line in the file, so they don't appear at all. This is such an error. I'm thinking I might make that automatic for any linter which is added.

from ale.

w0rp avatar w0rp commented on May 16, 2024

@scwood If you pull again, you should see a warning for the missing semicolon now. I fixed errors which have line numbers beyond the end of the file for any linter now.

from ale.

scwood avatar scwood commented on May 16, 2024

I'm not sure what I'm doing wrong. I'm updated to the latest code. On the left with the C file Ale is working great, but on the php file nothing happens:

screen shot 2016-10-04 at 11 28 07 am

from ale.

w0rp avatar w0rp commented on May 16, 2024

Hmm, could you paste the output of :!php -l -- < test.php and your php version? Maybe there is something wrong there.

I'll reopen the issue while you're having issues.

from ale.

scwood avatar scwood commented on May 16, 2024

Sure, here's the ouput of :!php -l -- < test.php:

Parse error: parse error, expecting `','' or `';'' in - on line 4
Errors parsing -

shell returned 255

Press ENTER or type command to continue

And php:

$ php --version
PHP 5.5.36 (cli) (built: May 29 2016 01:07:06)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies

from ale.

deathmaz avatar deathmaz commented on May 16, 2024

Hi, for me Ale works fine with php files:
https://asciinema.org/a/2h6zlyi99ialjdeia9gmiwteo

php -v

PHP 7.0.11 (cli) (built: Sep 16 2016 18:52:44) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

from ale.

scwood avatar scwood commented on May 16, 2024

Hmmm, I tried with Vim and NVim, no dice. Also tried with a minimal vimrc.

from ale.

w0rp avatar w0rp commented on May 16, 2024

I'm not quite certain where the problem lies at the moment. I might try installing that version of PHP tomorrow and see if there are any problems there. The PHP linting works for me at the moment. Have you checked the linters for other languages? I wonder if the problem is specific to the PHP linter.

from ale.

scwood avatar scwood commented on May 16, 2024

Yeah no issues using the other linters... I updated my plugin this morning. Still digging
screen shot 2016-10-05 at 7 50 02 pm

from ale.

scwood avatar scwood commented on May 16, 2024

I have no idea what's going on with this. I've installed ale on my work computer and php works without any issues, I don't know why it's broken on my laptop. I've reinstalled vim, made sure I'm not running my forked version, etc. etc. I'm just going to close for now.

from ale.

scwood avatar scwood commented on May 16, 2024

That did it, thanks so much.

from ale.

w0rp avatar w0rp commented on May 16, 2024

Nice! You're welcome.

from ale.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.