Giter Club home page Giter Club logo

gometalinter-linter's People

Contributors

joefitzgerald avatar lloiser avatar manucorporat avatar sarahhodne avatar tonyxiao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gometalinter-linter's Issues

Add gitignore-like ignore file

I'd like to have a .gometalinterignore file which would allow me to specify files to be ignored within a project's directory.

Vendored code not being seen.

Cannot figure out how to get this to actually "see" I have my files vendored. The vendor directory is there, the imported code is there in the proper places and the go code compiles and runs cleanly.

image

How do I just turn this off so it can be usable to me?

Editing file outside of GOPATH causes gometalinter to lint excessive files

I noticed this evening my laptop fan was spinning pretty fast. Turns out that gometalinter was eating up all my CPU cycles. I believe this is because I was editing a golang file outside of my GOPATH, in the base of my home directory, and gometalinter decided to lint every file in my home directory (and below) as a result.

The reason I believe this is because, after waiting a while, at the bottom of the Atom window, the Project counter was 3700+ and clicking on it showed gometalinter results for files other than the one I'm currently working on.

This is Go 1.6 with Atom 1.6.0 and the latest go-plus. To reproduce, just "atom file.go" from your home directory and watch gometalinter go crazy.

Suddenly "no go in $PATH"

Suddenly some lints stop work.
In dev tools console:

gometalinter-linter: (stderr) WARNING: exec: "go": executable file not found in $PATH
WARNING: exec: "go": executable file not found in $PATH
---20 lines with same content---

but goconst linter works...

PS: clone of alecthomas/gometalinter#168

not honoring configuration setting for commandline options

I'm still getting linter warnings with my gometalinter command line options set to disable everything.

  "gometalinter-linter":
    args: [
      "--disable-all"
      "."
    ]

I tried this because no matter what I set my command line options to I was getting warnings and I'm not getting these same warnings when I run gometalinter from the command line with the same settings. Eventually I boiled the list down to something as simple as --disable-all not working.

Atom 1.11.2, gometalinter-linter 1.2.2

Output ordering

I thought it would be great to see errors before warnings, so I've modified the gometaliner arguments to include --sort flag as follows:

--vendor, --fast, --json, --sort=severity

It seems to work correctly only on the first run though (after restarting Atom, on first save); all subsequent saves are out of order.

Not passing -e argument to gometalinter

Package version: 1.0.6
Atom version: 1.7.0-beta0 and 1.6.0
OS: OS X El Capitan

I have configured gometalinter-linter to pass --fast, --vendor, --json, -e 'comment', . to gometalinter, but it keeps warning me about what I dont't want to be warned.

screen shot 2016-03-23 at 13 12 10

Using gometalinter on command-line on the same file, just works well.

screen shot 2016-03-23 at 13 14 05

Thanks.

Add ability to choose linters to run

Currently it executes all of available linters, which results in duplicate messages. It would be nice to be able to choose the linters to be executed.

Linter messages are off by one line

I've noticed that all the linter messages seem to be off by one line, showing the error on the line below where it should:

2016-03-16-17-51-52_765x560

Running gometalinter directly gives me the right line:

➜  cloud-brain git:(hh-heroku) ✗ gometalinter --vendor --fast --json ./...
[
[…]
  {"linter":"golint","severity":"warning","path":"background/memory.go","line":54,"col":1,"message":"exported method MemoryBackend.ScheduleAt should have comment or be unexported"},
[…]

I tried re-running lint and reorganizing the file to make sure it was actually running on the latest version of the file, and it always shows up on the line below.

stage of the inspection

Hello.

On big projects check takes a lot of time (>2-5min).
It would be possible to add some indicator, which will show current state of lint? (like with issues count / no issues indicator)

Thanks in advance. And thanks for an excellent tools! :)

lint not working

go-plus used to be darn good at highlighting errors in code upon save. Saved me compiling to find them. As of today (I upgraded to Atom 1.6 and it seemed to update go-plus significantly) it reports "No Issues" even if I type in a blatantly wrong variable name, don't use a variable, or pretty much anything. It installed a whack of tools in my local "bin" directory on install (I have a couple of different go project folders and scripts to change the GOPATH depending on what I'm doing), so maybe something about that is screwy? I'm using ubuntu 15.10. But the old one worked fine. Unfortunate.

Ignore file pattern

I can't find a way to ignore specific files. I have some generated code files that gometalinter complains about but that I can't fix. Such as asset files generated by go-bindata and ffjson files. It is quite annoying to have warnings coming up every time I save a file in my project. I don't want to just turn the warnings off though as I still want to see them for the code I am writing.

Is there a way to accomplish this? Is this within the scope of this plugin to accomplish?

provide instructions on how to display only errors

Turns on format on save, no way to see just errors (that flag doesn't seem to work), really really slow after hitting save, causes editor to flash when doing a save (probably due to format). If I disable the package, then I now no longer get build errors in atom on go files using just the go plus package.

gometalinter-linter not linting anymore

Run into a problem with gometalinter-linter today (installed via go-plus), it just wouldn’t lint anymore, was working fine some hours ago. I’m on OSX Yosemite 10.10.5. Can anyone help me resolve this?

I’ve confirmed gometalinter works just fine via the terminal, I’m not getting any lint details in my project currently, it just says “no issues”. I know there are issues because I was in the middle of linting the entire project. I’m on Atom version 1.7.2 (latest), your help would be very much appreciated

Proposition: use the non-official convention for Linter providers

What do you think about rename your repo and package name to use the non-established convention that almost all of Linter providers follow (linter-<providerName>)? Also, it would be great to reflect into the description that this is an Atom Linter plugin.

This changes could benefit third party tools and searches made with apm.

Uncaught TypeError: Path must be a string. Received undefined

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.10.2
Electron Version: 1.3.5
System: "Arch Linux"
Thrown From: gometalinter-linter package, v1.1.1

Stack Trace

Uncaught TypeError: Path must be a string. Received undefined

At path.js:7

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.dirname (path.js:1326:5)
    at GometalinterLinter.getLocatorOptions (/home/faddat/.atom/packages/gometalinter-linter/lib/linter.js:130:32)
    at GometalinterLinter.updateTools (/home/faddat/.atom/packages/gometalinter-linter/lib/linter.js:160:24)
    at atom-workspace.<anonymous> (/home/faddat/.atom/packages/gometalinter-linter/lib/linter.js:26:12)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/lib/atom/src/command-registry.js:260:29)
    at CommandRegistry.handleCommandEvent (/usr/lib/atom/src/command-registry.js:3:61)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/usr/lib/atom/src/command-registry.js:160:19)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (/usr/lib/atom/src/atom-environment.js:1109:28)
    at EventEmitter.outerCallback (/usr/lib/atom/src/application-delegate.js:329:25)
    at emitTwo (events.js:106:13)
    at EventEmitter.emit (events.js:191:7)

Commands

     -0:14.1.0 core:paste (atom-text-editor.editor.is-focused)
     -0:00.2.0 golang:updatelinters (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "customFileTypes": {
      "source.ini": [
        ".buckconfig",
        ".flowconfig"
      ],
      "source.json": [
        ".arcconfig",
        "BUCK.autodeps"
      ],
      "source.python": [
        "BUCK"
      ]
    },
    "disabledPackages": [
      "tree-view"
    ]
  }
}

Installed Packages

# User
atom-live-server, v1.2.5 (inactive)
git-plus, v5.17.0 (inactive)
go-config, v1.2.3 (active)
go-get, v1.0.4 (active)
gometalinter-linter, v1.1.1 (active)
language-docker, v1.1.7 (active)
linter, v1.11.16 (active)
linter-docker, v0.1.2 (active)
linter-jsonlint, v1.3.0 (active)
nuclide, v0.167.1 (active)
pretty-json, v1.6.0 (active)
atom-dark-syntax, v0.27.0 (inactive)
atom-dark-ui, v0.52.0 (inactive)
atom-light-syntax, v0.28.0 (inactive)
atom-light-ui, v0.44.0 (inactive)
base16-tomorrow-dark-theme, v1.1.0 (inactive)
base16-tomorrow-light-theme, v1.1.1 (inactive)
one-dark-ui, v1.5.0 (active)
one-light-ui, v1.5.0 (inactive)
one-dark-syntax, v1.3.0 (active)
one-light-syntax, v1.3.0 (inactive)
solarized-dark-syntax, v1.0.2 (inactive)
solarized-light-syntax, v1.0.2 (inactive)
about, v1.5.3 (active)
archive-view, v0.61.1 (active)
autocomplete-atom-api, v0.10.0 (active)
autocomplete-css, v0.11.2 (active)
autocomplete-html, v0.7.2 (active)
autocomplete-plus, v2.31.1 (active)
autocomplete-snippets, v1.11.0 (active)
autoflow, v0.27.0 (inactive)
autosave, v0.23.1 (active)
background-tips, v0.26.1 (active)
bookmarks, v0.41.0 (active)
bracket-matcher, v0.82.1 (active)
command-palette, v0.38.0 (inactive)
deprecation-cop, v0.54.1 (active)
dev-live-reload, v0.47.0 (active)
encoding-selector, v0.22.0 (active)
exception-reporting, v0.39.0 (active)
find-and-replace, v0.201.0 (inactive)
fuzzy-finder, v1.3.0 (active)
git-diff, v1.1.0 (active)
go-to-line, v0.31.0 (inactive)
grammar-selector, v0.48.1 (active)
image-view, v0.58.2 (active)
incompatible-packages, v0.26.1 (active)
keybinding-resolver, v0.35.0 (active)
line-ending-selector, v0.5.0 (active)
link, v0.31.1 (inactive)
markdown-preview, v0.158.0 (active)
metrics, v0.53.1 (active)
notifications, v0.65.0 (active)
open-on-github, v1.2.0 (inactive)
package-generator, v1.0.0 (inactive)
settings-view, v0.242.2 (active)
snippets, v1.0.2 (active)
spell-check, v0.67.1 (active)
status-bar, v1.4.1 (active)
styleguide, v0.47.0 (active)
symbols-view, v0.113.0 (inactive)
tabs, v0.100.2 (active)
timecop, v0.33.2 (active)
tree-view, v0.208.2 (inactive)
update-package-dependencies, v0.10.0 (active)
welcome, v0.34.0 (active)
whitespace, v0.33.0 (active)
wrap-guide, v0.38.1 (active)
language-c, v0.52.1 (active)
language-clojure, v0.21.0 (active)
language-coffee-script, v0.47.2 (active)
language-csharp, v0.12.1 (active)
language-css, v0.37.1 (active)
language-gfm, v0.88.0 (active)
language-git, v0.15.0 (active)
language-go, v0.42.1 (active)
language-html, v0.45.1 (active)
language-hyperlink, v0.16.0 (active)
language-java, v0.23.0 (active)
language-javascript, v0.119.0 (active)
language-json, v0.18.2 (active)
language-less, v0.29.5 (active)
language-make, v0.22.2 (active)
language-mustache, v0.13.0 (active)
language-objective-c, v0.15.1 (active)
language-perl, v0.35.0 (active)
language-php, v0.37.2 (active)
language-property-list, v0.8.0 (active)
language-python, v0.45.0 (active)
language-ruby, v0.69.0 (active)
language-ruby-on-rails, v0.25.0 (active)
language-sass, v0.56.0 (active)
language-shellscript, v0.22.4 (active)
language-source, v0.9.0 (active)
language-sql, v0.23.0 (active)
language-text, v0.7.1 (active)
language-todo, v0.28.0 (active)
language-toml, v0.18.0 (active)
language-xml, v0.34.9 (active)
language-yaml, v0.26.0 (active)

# Dev
No dev packages

Private repo import errors

My imports from a private Github repo are no longer being found by this tool (Windows 10, Go 1.4). I also had to run 'go get' again for various google.golang.org packages after updating.

Linter error/warning 'jewels' in the sidebar are hard to use

It's a lot of effort now to display the reason that a specific line was marked as having a linter error. I think that I need to select all initial whitespace on a line to get it? For lines with no initial whitespace, it seems to display when I place the cursor in the leftmost position on the line?

Can this be made easier to trigger?

Make Package Configurable

It'd be great if we could add command line flags for gometalinter.

(I'd like to be able to disable dupl, since it can be a little bit too overzealous with checking for duplicated code, but all options would be nice.)

could not import error creeps up

could not import fmt (can't find import: fmt) (gotype)

I am not getting any imports right. So the whole project is showing errors. But when I run my program it runs flawlessly. I tried running gometalinter independently from terminal. It has no issues but the gometalinter-linter showing error from gometalinter

Linter is showing errors that don't exist after update

I updated Atom and subsequently all my installed packages today and now I'm getting an exuberant amount of false errors reported on my Go files.

Atom loads properly without any errors and I can even confirm go get works because it had to download dlv. Right now I'm looking at a file that is reporting 323 issues pretty much all of which are related to gometalinter not being able to find imported packages; including but not limited to core packages:

gometalinter
Error
could not import bytes (reading export data: /usr/lib/go/pkg/linux_amd64/bytes.a: unknown version: ��v1�    bytes��
��5$GOROOT/src/bytes/buffer.go���Buffer��) (gotype)at line 4 col 2
gometalinter
Error
could not import encoding/json (reading export data: /usr/lib/go/pkg/linux_amd64/encoding/json.a: unknown version: ��v1��json�  ��E$GOROOT/src/encoding/json/decode.go���Un) (gotype)at line 5 col 2
gometalinter
Error
could not import fmt (reading export data: /usr/lib/go/pkg/linux_amd64/fmt.a: unknown version: ��v1��fmt��
��-$GOROOT/src/fmt/scan.go��  State����� �pr) (gotype)at line 6 col 2
gometalinter
Error
could not import io/ioutil (reading export data: /usr/lib/go/pkg/linux_amd64/io/ioutil.a: unknown version: ��v1��ioutil�    ��=$GOROOT/src/io/ioutil/ioutil.goR
ReadA) (gotype)at line 7 col 2
gometalinter
Error
could not import net/http (reading export data: /usr/lib/go/pkg/linux_amd64/net/http.a: unknown version: ��v1��http��
��A$GOROOT/src/net/http/transport.go�!�Cli) (gotype)at line 8 col 2
gometalinter
Error
could not import net/url (reading export data: /usr/lib/go/pkg/linux_amd64/net/url.a: unknown version: ��v1��url��
��3$GOROOT/src/net/url/url.go��   Error������) (gotype)at line 9 col 2
gometalinter
Error
could not import strconv (reading export data: /usr/lib/go/pkg/linux_amd64/strconv.a: unknown version: ��v1�
strconv�    ��5$GOROOT/src/strconv/atob.go��ParseBoo) (gotype)at line 10 col 2
gometalinter
Error
could not import strings (reading export data: /usr/lib/go/pkg/linux_amd64/strings.a: unknown version: ��v1�
strings�    ��;$GOROOT/src/strings/compare.go�
Compa) (gotype)at line 11 col 2
gometalinter
Error
could not import time (reading export data: /usr/lib/go/pkg/linux_amd64/time.a: unknown version: ��v1��time����3$GOROOT/src/time/format.got ANSIC�2-/Mon) (gotype)at line 12 col 2
atom --version                                                                                                                                                                                               
Atom    : 1.9.9
Electron: 0.37.8
Chrome  : 49.0.2623.75
Node    : 5.10.0
Linux <host> 4.7.1-1-ARCH #1 SMP PREEMPT Wed Aug 17 08:13:35 CEST 2016 x86_64 GNU/Linux

--disable flag not working?

The "gometalinter Arguments" section of the plugin's settings in Atom reads:

--disable=gocyclo, gotype --vendor --json

However, I keep getting warnings and errors from both the "gocyclo" and the "gotype" tool (via gometalinter) when I press save.

What am I doing wrong?

gometalinter run although disabled in configuration

I currently have an issue with gotype not recognizing my vendored packages and thought I can disable linting altogether using the configuration of go-plus / Settings / and disable "lint on save". However it seems as gometalinter still runs as it reports linting errors.

I thought that disabling "Lint on save" should disable linting?

Opens up error in non-existent file

My codebase suddenly got into a state where, if I hit the "show next error" keyboard shortcut, it opens a new, blank file named system/vet: manager.go: manager.go.

Looks like the output from gometalinter is being misparsed. There's a genuine error somewhere in the code, but that's not a file name.

Here's a screenshot.

screen shot 2016-09-30 at 21 39 00

Developer console shows this:

screen shot 2016-09-30 at 21 39 09

Latest versions of gometalinter and gometalinter-linter.

Magic values for message position range

for (let message of messages) {
      let range
      if (message.col && message.col >= 0) {
        range = [[message.line - 1, message.col - 1], [message.line - 1, 1000]]
      } else {
        range = [[message.line - 1, 0], [message.line - 1, 1000]]
      }
      results.push({name: message.linter, type: capitalizeFirstLetter(message.severity), row: message.line, column: message.col, text: message.message + ' (' + message.linter + ')', filePath: path.join(cwd, message.path), range: range})
}

1000 makes underlined everything after the position, even semicolons and comments.

linter ignores settings "dupl"

I've added following lines to Atom config:

gometalinter-linter":
    args: [
      "--disable=dupl"
      "--dupl-threshold=500"
    ]

gometalinter still runs dull linter on my code and reports "duplicate" warning. I also tried to increase threshold - no impact.

Toggle on/off or resize the linter window

Hi, is there a possibility to bind the linter to a key and toggle it on/off?
Latest version takes half of the screen for warnings... and apparently isn't resizable. So either one or the other I guess.

Linter options

Hi,

I'm not sure if this is a bug or I'm doing it wrong, but it's possible to set options for a specific linter?, like: "--enable=errcheck -ignore Close"

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.