Code Monkey home page Code Monkey logo

Comments (30)

w0rp avatar w0rp commented on May 22, 2024

@neersighted Could you paste the output of Vint on a file with some problems from your machine? I can check the lines against the regex, and see if there's some kind of issue there.

from ale.

neersighted avatar neersighted commented on May 22, 2024

Sure... Something funky is going on, as some quick print-debugging is showing that HandleGCCFormat is not getting called. If it matters, my shell is fish.

Here's some vint output on my system:

plugin/unimpaired.vim:6:11: Prefer single quoted strings (see Google VimScript Style Guide (Strings))
plugin/unimpaired.vim:16:28: Use robust operators `==#` or `==?` instead of `==` (see Google VimScript Style Guide (Matching))
plugin/unimpaired.vim:16:44: Use robust operators `==#` or `==?` instead of `==` (see Google VimScript Style Guide (Matching))
plugin/unimpaired.vim:41:31: Prefer single quoted strings (see Google VimScript Style Guide (Strings))
plugin/unimpaired.vim:42:32: Prefer single quoted strings (see Google VimScript Style Guide (Strings))
plugin/unimpaired.vim:43:44: Prefer single quoted strings (see Google VimScript Style Guide (Strings))
plugin/unimpaired.vim:43:47: Prefer single quoted strings (see Google VimScript Style Guide (Strings))
plugin/unimpaired.vim:63:13: Use robust operators `==#` or `==?` instead of `==` (see Google VimScript Style Guide (Matching))
plugin/unimpaired.vim:298:10: Use robust operators `=~#` or `=~?` instead of `=~` (see Google VimScript Style Guide (Matching))
plugin/unimpaired.vim:413:13: Use robust operators `=~#` or `=~?` instead of `=~` (see Google VimScript Style Guide (Matching))
plugin/unimpaired.vim:415:17: Use robust operators `=~#` or `=~?` instead of `=~` (see Google VimScript Style Guide (Matching))
plugin/unimpaired.vim:416:16: Prefer single quoted strings (see Google VimScript Style Guide (Strings))
plugin/unimpaired.vim:416:40: Prefer single quoted strings (see Google VimScript Style Guide (Strings))
plugin/unimpaired.vim:417:17: Use robust operators `==#` or `==?` instead of `==` (see Google VimScript Style Guide (Matching))
plugin/unimpaired.vim:419:17: Use robust operators `==#` or `==?` instead of `==` (see Google VimScript Style Guide (Matching))
plugin/unimpaired.vim:422:16: Prefer single quoted strings (see Google VimScript Style Guide (Strings))
plugin/unimpaired.vim:433:13: Use robust operators `=~#` or `=~?` instead of `=~` (see Google VimScript Style Guide (Matching))

from ale.

neersighted avatar neersighted commented on May 22, 2024

Here's the same thing with ale's formatting string:

plugin/unimpaired.vim:6:11: warning: Prefer single quoted strings (see Google VimScript Style Guide (Strings))
plugin/unimpaired.vim:16:28: warning: Use robust operators `==#` or `==?` instead of `==` (see Google VimScript Style Guide (Matching))
plugin/unimpaired.vim:16:44: warning: Use robust operators `==#` or `==?` instead of `==` (see Google VimScript Style Guide (Matching))
plugin/unimpaired.vim:41:31: warning: Prefer single quoted strings (see Google VimScript Style Guide (Strings))
plugin/unimpaired.vim:42:32: warning: Prefer single quoted strings (see Google VimScript Style Guide (Strings))
plugin/unimpaired.vim:43:44: warning: Prefer single quoted strings (see Google VimScript Style Guide (Strings))
plugin/unimpaired.vim:43:47: warning: Prefer single quoted strings (see Google VimScript Style Guide (Strings))
plugin/unimpaired.vim:63:13: warning: Use robust operators `==#` or `==?` instead of `==` (see Google VimScript Style Guide (Matching))
plugin/unimpaired.vim:298:10: warning: Use robust operators `=~#` or `=~?` instead of `=~` (see Google VimScript Style Guide (Matching))
plugin/unimpaired.vim:413:13: warning: Use robust operators `=~#` or `=~?` instead of `=~` (see Google VimScript Style Guide (Matching))
plugin/unimpaired.vim:415:17: warning: Use robust operators `=~#` or `=~?` instead of `=~` (see Google VimScript Style Guide (Matching))
plugin/unimpaired.vim:416:16: warning: Prefer single quoted strings (see Google VimScript Style Guide (Strings))
plugin/unimpaired.vim:416:40: warning: Prefer single quoted strings (see Google VimScript Style Guide (Strings))
plugin/unimpaired.vim:417:17: warning: Use robust operators `==#` or `==?` instead of `==` (see Google VimScript Style Guide (Matching))
plugin/unimpaired.vim:419:17: warning: Use robust operators `==#` or `==?` instead of `==` (see Google VimScript Style Guide (Matching))
plugin/unimpaired.vim:422:16: warning: Prefer single quoted strings (see Google VimScript Style Guide (Strings))
plugin/unimpaired.vim:433:13: warning: Use robust operators `=~#` or `=~?` instead of `=~` (see Google VimScript Style Guide (Matching))

from ale.

w0rp avatar w0rp commented on May 22, 2024

Hmm, do you have bash installed on your machine? That might be the issue.

from ale.

w0rp avatar w0rp commented on May 22, 2024

If the answer to that is "no," do you have a good old Bourne Shell (sh) installed?

from ale.

neersighted avatar neersighted commented on May 22, 2024

That is indeed the issue, when I override SHELL to bash, it works.

from ale.

w0rp avatar w0rp commented on May 22, 2024

Maybe the shebang line in the Bash wrapper script is to blame. What's the output of which bash?

from ale.

neersighted avatar neersighted commented on May 22, 2024

/usr/bin/bash, however, this is arch, so /usr/bin is a symlink and the real bash is /bin/bash.

from ale.

w0rp avatar w0rp commented on May 22, 2024

If you edit stdin-wrapper and change the shebang line to #!/usr/bin/env bash, does that work?

from ale.

neersighted avatar neersighted commented on May 22, 2024

It does nothing, and it looks like stdin-wrapper never runs. I do believe the issue is in Vim, probably when it tries to execute stdin-wrapper. By the way, mktemp has a --suffix option, no need for gymnastics.

from ale.

neersighted avatar neersighted commented on May 22, 2024

I'm guessing something with the generated command is going wrong.

This is what I get on my system:

/home/neersighted/.config/nvim/bundles/ale//stdin-wrapper .vim vint -w --no-color -f "{file_path}:{line_number}:{column_number}: {severity}: {description} (see {reference})

I'm wondering, why is there only one quote?

from ale.

neersighted avatar neersighted commented on May 22, 2024

...the missing quote fixed it.

from ale.

w0rp avatar w0rp commented on May 22, 2024

That quote is suspicious. @KabbAmine added that, and it was conspicuously only running if there was a single quote there. Which was... very odd.

from ale.

neersighted avatar neersighted commented on May 22, 2024

It works for me in bash and in fish with both quotes. I can send a PR with the quote fix, shebang change and mktemp change if you'd like.

from ale.

w0rp avatar w0rp commented on May 22, 2024

I pushed a commit now with just that fix for the quote.

@KabbAmine Do you want to test Vint linting again on your machine? You had the issue originally with the quote.

from ale.

w0rp avatar w0rp commented on May 22, 2024

Ah, I recall now. Somehow... for some reason, the double quote appears in the echoed message if you add it. I'll see what I can do about that.

from ale.

w0rp avatar w0rp commented on May 22, 2024

For now, it's dinner and X-Files time.

from ale.

w0rp avatar w0rp commented on May 22, 2024

Check out the branch fix-vint-issues, with the commit referenced above. I don't know what's going on with the double quote issue, but I can avoid it, and it seems to work. Try it out and let me know how it goes.

from ale.

w0rp avatar w0rp commented on May 22, 2024

I also noticed separately that vint has a -s flag which I could add an option for, and which could be applied in Travis for this repository. I'll make it happen after this bug has been fixed.

from ale.

neersighted avatar neersighted commented on May 22, 2024

As a matter of fact, master works fine and fix-vint-issues does not.

from ale.

neersighted avatar neersighted commented on May 22, 2024

I don't see quotes with fish, zsh, or bash on master.
fix-vint-issues only works on bash for me.

from ale.

neersighted avatar neersighted commented on May 22, 2024

Why don't we just use escaped singlequotes for the whole thing? And I'd prefer to keep the vint parsing based on GCC, if possible. The fewer lines of code, the better.

from ale.

w0rp avatar w0rp commented on May 22, 2024

The trouble is that somehow quotes can appear in the text. I get some lines like so: Unexpected EOL (see ynkdir/vim-vimlparser)"

I don't quite understand how that's happening.

from ale.

neersighted avatar neersighted commented on May 22, 2024

Try logging everything to a file in your stdin-wrapper so you can look over the raw text? The layers of abstraction might be munging things.

from ale.

w0rp avatar w0rp commented on May 22, 2024

I think I have found the issue. NeoVim does not show the issue on my machine. I looked at the documentation for jobstart() in NeoVim, and it said that it executes command strings as if you had passed the commands like split(&shell) + split(&shellcmdflag) + [command]. So I did exactly that for Vim 8. That seems to fix the issue on my machine.

from ale.

w0rp avatar w0rp commented on May 22, 2024

Curiously, the job_start() documentation for Vim 8 says the command works better as a String on Windows and a List on Unix, so... I'll keep using a string on Windows.

from ale.

neersighted avatar neersighted commented on May 22, 2024

Sweet! I can confirm master functions for me in fish and bash.

from ale.

neersighted avatar neersighted commented on May 22, 2024

Lists are really the proper way to execute commands anyway, shell parsing makes things screwy when you use strings.

from ale.

w0rp avatar w0rp commented on May 22, 2024

Yeah. I don't know why Vim's documentation says Windows is different, but I'll just accept that. I'll consider this issue closed.

from ale.

KabbAmine avatar KabbAmine commented on May 22, 2024

Good job guys 👍

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.