plexsystems / vscode-protolint

A protobuf linter for visual studio code
MIT License
52 stars 14 forks source link

Lint not working #7

Closed LucasBassetti closed 4 years ago

LucasBassetti commented 4 years ago

The lint is not working in my vscode.

If I run protolint lint command in terminal it works fine.


vscode version: 1.39.2 macOS version: 10.15.1

I appreciate any help! Thanks!

jpreese commented 4 years ago

I'll take a look at this tonight @LucasBassetti. In the meantime, can you confirm which version of the extension you're using?

Also make sure that you have an extension that adds the proto or proto3 language to your vscode. I personally use https://marketplace.visualstudio.com/items?itemName=zxh404.vscode-proto3

LucasBassetti commented 4 years ago

I'm using vscode-proto3 0.3.0 and vscode-protolint 0.2.0

jpreese commented 4 years ago

Thanks for the added information. I'm on vscode 1.37 and it seems to be working. Let me update to 1.39.2

jpreese commented 4 years ago

Could you give some information about what your folder structure looks like for your project?

I'm mostly curious about what folder you're opening in vscode and where your .protolint.yml file is. I'm wondering if it's not able to find your configuration file in the setup you have.

LucasBassetti commented 4 years ago
root
  |_ protos
      example.proto
  .protolint.yaml

I also tried

root
   example.proto
  .protolint.yaml
jpreese commented 4 years ago

Hm.. Ok, everything at the surface level appears to be correct. Let me dig out my macbook and see if its OS related.

You're running the actual protolint binary and I'm assuming the results are coming back as you expect. So your protolint version is correct.

The extension does need you to save the .proto file for it to kick in, so make sure you're attempting to make a change and save it. The results should be printed to the problems window.

Is this your first time trying to use the extension? Or did this stop working after 0.2.0?

LucasBassetti commented 4 years ago

It's my first time.

Example of result with protolint:

image

LucasBassetti commented 4 years ago

I fixed it!

The problem is that GOPATH was not added to PATH by default. I added it using the commands below, but when I restarted the terminal protolint stop works and I need to run it again

export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin

I solved adding it as default using this tutorial

Thanks for helping me!

jpreese commented 4 years ago

Oh, awesome. Good to hear!