Giter VIP home page Giter VIP logo

linter-ruby's Introduction

linter-ruby

This linter plugin for Linter provides an interface to Ruby's builtin syntax analysis. It will be used with files that have the Ruby syntax.

Installation

On first activation the plugin will install all dependencies automatically, you no longer have to worry about installing Linter.

Just install this package and you'll be good to go.

Settings

You can configure linter-ruby by editing ~/.atom/config.cson (choose Open Your Config in Atom menu):

'linter-ruby':
  # ruby path. run `which ruby` to find the path.
  'rubyExecutablePath': null

  # ignored extensions, ERB and markdown files by default.
  'ignoredExtensions': 'erb, md'

linter-ruby's People

Contributors

ananevam avatar arcanemagus avatar beathyate avatar buo avatar ddavison avatar envygeeks avatar greenkeeper[bot] avatar greenkeeperio-bot avatar hd-deman avatar keplersj avatar kevinsawicki avatar ksss avatar lucasmazza avatar mupkoo avatar project0 avatar renovate-bot avatar semantic-release-bot avatar steelbrain avatar walles avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

linter-ruby's Issues

Not picking up method calls?

I've got this code:

# A reference to the File class for this file.
  attr_reader :file_reference
  alias :file :file_reference

  # Private method to set the File class reference.
  attr_writer :file_reference
  private :file_reference=

  # Private short-cut to clear the file reference.
  def clear_file_reference
    file_reference = nil
  end
  private :clear_file_reference

In clear_file_reference, linter-ruby keeps warning me I've got an "assigned but unused variable". I can't get rid of the warning! I've tried removing the private call. The only thing that works is @file_reference = nil.

Is there some setting I'm missing?

(Using linter-ruby 1.2.4)

Thanks!
Ian

Implement specs

It looks like this linter does not currently have any specs written for it, adding it to the list being maintained here for tracking.

Specs do not need to be super detailed, as they should mainly test whether the package is properly running the linter plugin and parsing its messages. Leave testing of the linter functionality to the author of the linter.

If you need any help feel free to ask!

Config.unobserve is deprecated.

Config::unobserve no longer does anything. Call .dispose() on the object returned by Config::observe instead.

Config.unobserve (/Applications/Atom.app/Contents/Resources/app.asar/src/config.js:1060:19)
LinterRuby.destroy (/Users/heather.huggins/.atom/packages/linter-ruby/lib/linter-ruby.coffee:30:16)
LinterView.remove (/Users/heather.huggins/.atom/packages/linter/lib/linter-view.coffee:252:6)
<unknown> (/Users/heather.huggins/.atom/packages/linter/lib/linter-view.coffee:124:7)

Uncaught Error: spawn EINVAL

[Enter steps to reproduce below:]

  1. Open any ruby file
  2. Hit CMD+S

Atom Version: 1.5.3
System: Mac OS X 10.11.3
Thrown From: linter-ruby package, v1.2.2

Stack Trace

Uncaught Error: spawn EINVAL

At /Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:260

Error: spawn EINVAL
    at exports._errnoException (util.js:837:11)
    at ChildProcess.spawn (internal/child_process.js:298:11)
    at Object.exports.spawn (child_process.js:351:9)
    at BufferedProcess.module.exports.BufferedProcess.spawn (/Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:188:44)
    at new BufferedProcess (/Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:52:14)
    at /Users/brodock/.atom/packages/linter-ruby/node_modules/atom-linter/lib/helpers.js:152:75
    at Object.exec (/Users/brodock/.atom/packages/linter-ruby/node_modules/atom-linter/lib/helpers.js:118:10)
    at Object.exec (/Users/brodock/.atom/packages/linter-ruby/node_modules/atom-linter/lib/index.js:158:18)
    at Object.lint (/Users/brodock/.atom/packages/linter-ruby/lib/main.js:43:24)
    at promises.push.Promise.then._this.emitter.emit.linter (/Users/brodock/.atom/packages/linter/lib/linter-registry.js:63:26)
    at /Users/brodock/.atom/packages/linter/lib/linter-registry.js:62:23
    at Set.forEach (native)
    at LinterRegistry.lint (/Users/brodock/.atom/packages/linter/lib/linter-registry.js:60:18)
    at /Users/brodock/.atom/packages/linter/lib/linter.coffee:98:16
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at /Users/brodock/.atom/packages/linter/lib/editor-linter.js:30:20
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at TextBuffer.module.exports.TextBuffer.saveAs (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1067:27)
    at TextBuffer.module.exports.TextBuffer.save (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1037:19)
    at TextEditor.module.exports.TextEditor.save (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:630:26)
    at Pane.module.exports.Pane.saveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:545:18)
    at Pane.module.exports.Pane.saveActiveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:528:19)
    at Workspace.module.exports.Workspace.saveActivePaneItem (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:649:35)
    at atom-workspace.commandRegistry.add.core:save (/Applications/Atom.app/Contents/Resources/app.asar/src/register-default-commands.js:173:32)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:536:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:359:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:97:36)
    at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61)

Commands

     -0:43.8.0 core:cancel (atom-text-editor.editor.mini.is-focused)
  4x -0:35.3.0 vim-mode:move-up (atom-text-editor.editor.vim-mode.normal-mode.is-focused)
     -0:34.4.0 vim-mode:insert-above-with-newline (atom-text-editor.editor.vim-mode.normal-mode.is-focused)
     -0:33.8.0 editor:newline (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:33.4.0 core:paste (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:32.8.0 core:move-up (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
  3x -0:32.3.0 core:undo (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
 46x -0:30.9.0 core:move-down (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
  5x -0:28.4.0 core:page-down (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:23.3.0 editor:newline (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:23 core:paste (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:22.6.0 core:save (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:21.7.0 core:move-up (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:21.3.0 editor:newline (atom-text-editor.editor.vim-mode.is-focused.insert-mode)
     -0:11.3.0 core:paste (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
     -0:00.0 core:save (atom-text-editor.editor.vim-mode.insert-mode.is-focused)

Config

{
  "core": {
    "excludeVcsIgnoredPaths": false,
    "ignoredNames": [
      ".git",
      ".svn",
      ".DS_Store",
      ".idea",
      ".bundle"
    ],
    "projectHome": "/Users/brodock/Projetos",
    "themes": [
      "nucleus-dark-ui",
      "one-dark-syntax"
    ]
  },
  "linter-ruby": {}
}

Installed Packages

# User
No installed packages

# Dev
No dev packages

Package.activateConfig is deprecated.

Use a config schema instead. See the configuration section
of https://atom.io/docs/latest/hacking-atom-package-word-count and
https://atom.io/docs/api/latest/Config for more details

Package.activateConfig (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:247:11)
Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:218:14)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:203:30)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:147:15)

false positives due to utf-8/german umlauts

The linter throws "unexpected end-of-input, expecting keyword_end" errors for both 'ö' characters in this simple ruby class:

class Foo
  flash = Hash.new
  flash[:alert] = 'Smörebröd'
end

Atom says that the encoding is UTF-8, the locales on my OS X system are also UTF-8.

Config.unobserve is deprecated.

Config::unobserve no longer does anything. Call .dispose() on the object returned by Config::observe instead.

Config.unobserve (/Applications/Atom.app/Contents/Resources/app.asar/src/config.js:1060:19)
LinterRuby.destroy (/Users/ryoutakoganezawa/.atom/packages/linter-ruby/lib/linter-ruby.coffee:30:16)
LinterView.remove (/Users/ryoutakoganezawa/.atom/packages/linter/lib/linter-view.coffee:252:6)
<unknown> (/Users/ryoutakoganezawa/.atom/packages/linter/lib/linter-view.coffee:124:7)

Uncaught Error: spawn EACCES

Hi,

I'm getting this error every time it checks a file after updating to the latest linter-ruby and latest atom.

Atom Version: 1.0.7
System: Mac OS X 10.10.4
Thrown From: linter-ruby package, v1.0.1

Stack Trace

Uncaught Error: spawn EACCES

At /opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:260

Error: spawn EACCES
  at exports._errnoException (util.js:734:11)
  at ChildProcess.spawn (child_process.js:1145:11)
  at Object.exports.spawn (child_process.js:977:9)
  at BufferedProcess.module.exports.BufferedProcess.spawn (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:188:44)
  at new BufferedProcess (/opt/homebrew-cask/Caskroom/atom/latest/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:52:14)
  at /Users/andrei/.atom/packages/linter-ruby/node_modules/atom-linter/lib/helpers.coffee:40:30
  at Object.module.exports.Helpers._exec (/Users/andrei/.atom/packages/linter-ruby/node_modules/atom-linter/lib/helpers.coffee:22:16)
  at Object.module.exports.Helpers.exec (/Users/andrei/.atom/packages/linter-ruby/node_modules/atom-linter/lib/helpers.coffee:13:13)
  at Object.lint (/Users/andrei/.atom/packages/linter-ruby/lib/main.js:45:24)
  at Promise.then._this.emitter.emit.linter (/Users/andrei/.atom/packages/linter/lib/linter-registry.coffee:57:22)
  at LinterRegistry.triggerLinter (/Users/andrei/.atom/packages/linter/lib/linter-registry.coffee:56:16)
  at /Users/andrei/.atom/packages/linter/lib/linter-registry.coffee:50:17
  at Array.map (native)
  at /Users/andrei/.atom/packages/linter/lib/linter-registry.coffee:48:27
  at process._tickCallback (node.js:367:9)

Commands

     -1:46.9.0 core:save (atom-text-editor.editor.is-focused)
     -1:46.5.0 editor:newline (atom-text-editor.editor.is-focused)
  5x -1:35.7.0 core:backspace (atom-text-editor.editor.is-focused)
     -1:26.5.0 project-find:show (atom-text-editor.editor.is-focused)
     -1:24.5.0 core:confirm (atom-text-editor.editor.mini.is-focused)
  2x -1:19.1.0 find-and-replace:focus-next (atom-text-editor.editor.mini.is-focused)
  2x -1:17.5.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -1:02.1.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -1:01.7.0 core:select-all (atom-text-editor.editor.mini.is-focused)
  9x -1:01.4.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -0:39.6.0 autocomplete-plus:confirm (atom-text-editor.editor.is-focused.autocomplete-active)
     -0:27.9.0 core:save (atom-text-editor.editor.is-focused)
     -0:05.8.0 fuzzy-finder:toggle-file-finder (atom-text-editor.editor.is-focused)
     -0:04.0 core:select-all (atom-text-editor.editor.mini.is-focused)
     -0:02.1.0 core:move-down (atom-text-editor.editor.mini.is-focused)
     -0:01.5.0 core:confirm (atom-text-editor.editor.mini.is-focused)

Config

{
  "core": {
    "ignoredNames": [
      ".git",
      ".svn",
      ".DS_Store"
    ],
    "themes": [
      "atom-light-ui",
      "atom-light-syntax"
    ],
    "disabledPackages": [
      "RubyMotion"
    ]
  },
  "linter-ruby": {
    "rubyExecutablePath": "/Users/andrei/.rvm/rubies/ruby-2.1.6/bin"
  }
}

Installed Packages

# User
autocomplete-paths, v1.0.2
autocomplete-ruby, v0.1.0
compare-files, v0.6.2
cucumber, v0.5.0
git-log, v0.4.1
language-haml, v0.21.0
language-html, v0.40.1
language-latex, v0.6.1
language-mustache, v0.12.0
language-rust, v0.4.4
language-slim, v0.5.0
linter, v1.3.4
linter-coffeescript, v1.0.0
linter-erb, v0.1.1
linter-haml, v1.0.0
linter-htmlhint, v0.1.1
linter-rubocop, v0.3.1
linter-ruby, v1.0.1
linter-slim, v1.0.0
ruby-block, v0.3.5

# Dev
No dev packages

unexpected hash syntax

gem 'therubyracer', platforms: :ruby

Ruby syntax error unexpected ':', expecting $end

gemfile_ __volumes_u_2_projects_dota2farm_server

Using
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-darwin12.0]
rvm 1.26.11 (latest)

No longer works

It doesn't work with latest atom version, it throws this:

Use a config schema instead. See the configuration section of https://atom.io/docs/latest/hacking-atom-package-word-count and https://atom.io/docs/api/latest/Config for more details
Called 1 time
Package.activateConfig - /opt/atom/resources/app/src/package.js:250:11
Package.activateNow - /opt/atom/resources/app/src/package.js:221:14
Use activationCommands instead of activationEvents in your package.json Commands should be grouped by selector as follows:
"activationCommands": {
"atom-workspace": ["foo:bar", "foo:baz"],
"atom-text-editor": ["foo:quux"]
}
Called 1 time
Package.getActivationCommands - /opt/atom/resources/app/src/package.js:764:9
Package.hasActivationCommands - /opt/atom/resources/app/src/package.js:689:20

Ruby 2.4

Hi.

First of all, thank you very much for this linter! I'm happy to use it.
But I have an issue running the linter with Ruby 2.4. Looks like it's just not working.
Yet on the same Atom configuration (Atom 1.13 with sync-settings plugin) but on Ruby 2.3.1 it works just fine.

Regards,
Slava

Settings — Include extensions

atom_-_ruby_linter

Please add option to set included extensions. The image above reports Ruby syntax error in Terraform file. It seems to me more user friendly to tell "use this linter just for .rb", than having to explicitly turn it off for all the other extensions (currently there is option to ignore some extensions).

changelog use

Any chance you could make use of the change log so we can know what got fixed in each version?
Thanks!

Error: spawn ruby ENOENT

Getting this error:

Error: spawn ruby ENOENT
    at exports._errnoException (util.js:837:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at doNTCallback2 (node.js:441:9)
    at process._tickCallback (node.js:355:17)

The error doesn't appear if I open Atom from the directory of the project using Terminal.

Config.unobserve is deprecated.

Config::unobserve no longer does anything. Call .dispose() on the object returned by Config::observe instead.

Config.unobserve (/opt/github/atom/share/atom/resources/app/src/config.js:1045:19)
LinterRuby.destroy (/home/jordon/.atom/packages/linter-ruby/lib/linter-ruby.coffee:30:16)

Failed to activate the linter-ruby package

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.3.2
System: Mac OS X 10.11.2
Thrown From: linter-ruby package, v1.2.1

Stack Trace

Failed to activate the linter-ruby package

At packageName is required

Error: packageName is required
    at Object.install (/Users/erri/.atom/packages/linter-csslint/node_modules/atom-package-deps/lib/main.js:19:27)
    at Object.activate (/Users/erri/.atom/packages/linter-ruby/lib/main.js:21:34)
    at Package.module.exports.Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:170:19)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:150:32
    at Package.module.exports.Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:92:15)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/package.js:143:26
    at Package.module.exports.Package.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:140:34)
    at PackageManager.module.exports.PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:517:21)
    at /Applications/Atom.app/Contents/Resources/app.asar/node_modules/settings-view/lib/package-manager.js:444:29
    at exit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/settings-view/lib/package-manager.js:73:16)
    at triggerExitCallback (/Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:213:47)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:227:18
    at Socket.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:98:18)
    at emitOne (events.js:82:20)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)

Commands

     -8:23 fuzzy-finder:toggle-file-finder (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
     -8:15.4.0 core:confirm (atom-text-editor.editor.mini.is-focused)
     -7:32.4.0 git-plus:menu (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
  3x -4:30.7.0 tree-view:toggle (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
     -3:03.3.0 core:confirm (atom-text-editor.editor.mini.is-focused)
 11x -2:29.4.0 core:backspace (atom-text-editor.editor.mini.is-focused)
     -2:26.9.0 core:confirm (atom-text-editor.editor.mini.is-focused)

Config

{
  "core": {
    "disabledPackages": [
      "symbols-view"
    ]
  }
}

Installed Packages

# User
atom-ctags, v4.4.2
autocomplete-ruby, v0.1.0
emmet, v2.3.17
git-log, v0.4.1
jshint, v1.8.3
linter, v1.11.3
linter-csslint, v1.2.0
linter-jshint, v1.2.2
linter-ruby, v1.2.1
ruby-slim, v0.2.0

# Dev
No dev packages

Is this repo dead?

There hasn't been an update for nearly a year and nothing is happening about the deprecation before 1.0 happens which means this package will stop working... If you need help please just say so.

Ruby 2.3.0 support

I rely on your linter every day, it does an amazing job! However, since upgrading to Ruby 2.3.0 I get syntax errors, specifically for the lonely operator. Is Ruby 2.3.0 support planned for the next release?

linter-ruby does not support Lint on the fly

I have been holding off on updating for a while due to linter-ruby not being upgraded for linter 1.3. Then there was an update, but it was broken. Finally this morning it's working again, but it only seems to lint when I save the file.

I checked my settings under linter and sure enough Lint on the fly is checked.

I checked in with the linter folks and was informed its a problem with linter-ruby:
steelbrain/linter#824

They said it SAYS linter-ruby supports lintOnFly, but it only passes linter the current file name so it can only be used as lintOnSave as currently written.

Ignore lint

Hey guys,

It would be great if you could ignore a lint on a one by one as well as 'type' basis.

I know it could be done via the setting "for a type" warning hard removal but a nice interface to choose the warnings you want would be cool.

If I get time I'll code it up :)

always mark the same error

if i wanna save mi work, always says in the same line no matter if i change the code, always mark that warning in the same lines ( 6 and 7)

warning: assigne but unused variable

Warning when using a en dash (–) in a string

A picture is worth a thousand words, as they say.

screen shot 2017-04-22 at 15 25 03

ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin16]
ruby -wc path/to/file.rb returns Syntax OK

Let me know if you need additional information

Uncaught Error: spawn ENOTDIR

Atom Version: 1.0.5
System: linux 3.14.46-gentoo
Thrown From: linter-ruby package, v1.0.0

Stack Trace

Uncaught Error: spawn ENOTDIR

At /usr/share/atom/resources/app.asar/src/buffered-process.js:260

Error: spawn ENOTDIR
    at exports._errnoException (util.js:734:11)
    at ChildProcess.spawn (child_process.js:1145:11)
    at Object.exports.spawn (child_process.js:977:9)
    at BufferedProcess.module.exports.BufferedProcess.spawn (/usr/share/atom/resources/app.asar/src/buffered-process.js:188:44)
    at new BufferedProcess (/usr/share/atom/resources/app.asar/src/buffered-process.js:52:14)
    at /home/foo/.atom/packages/linter-ruby/node_modules/atom-linter/lib/helpers.coffee:100:28
    at Object.module.exports.Helpers._exec (/home/foo/.atom/packages/linter-ruby/node_modules/atom-linter/lib/helpers.coffee:57:14)
    at Object.module.exports.Helpers.exec (/home/foo/.atom/packages/linter-ruby/node_modules/atom-linter/lib/helpers.coffee:27:19)
    at Object.lint (/home/foo/.atom/packages/linter-ruby/lib/main.js:43:24)
    at Promise.then._this.emitter.emit.linter (/home/foo/.atom/packages/linter/lib/linter-registry.coffee:95:31)

Commands

     -0:03.0 core:backspace (atom-text-editor.editor.is-focused)
     -0:02.2.0 core:save (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "ignoredNames": [
      "*~",
      "#~"
    ],
    "disabledPackages": [
      "metrics",
    ]
  },
  "linter-ruby": {
    "rubyExecutablePath": "/home/foo/.rbenv/shims/ruby"
  }
}

Installed Packages

# User
language-haml, v0.21.0
linter, v1.3.2
linter-haml, v1.0.0
linter-ruby, v1.0.0
ruby-block, v0.3.5

# Dev
No dev packages

Object.activate is deprecated.

AtomLinter v0.X.Y API has been deprecated. Please refer to the Linter docs to update and the latest API: https://github.com/AtomLinter/Linter/wiki/Migrating-to-the-new-API

Object.activate (/Users/erik/.atom/packages/linter/lib/main.coffee:57:8)
Package.activateNow (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:240:19)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:221:30)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:165:15)
Package.activate (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:213:14)
PackageManager.activatePackage (/Applications/Atom.app/Contents/Resources/app.asar/src/package-manager.js:452:21)

Linter mis-identifies a required keyword argument as a syntax error

I think I found a bug. I defined a method with a keyword argument, but no default value, which makes it a required argument.

class Activities::AncestorsQuery
  def initialize(activities:)
  end
end

This is valid as of Ruby 2.1, per (https://robots.thoughtbot.com/ruby-2-keyword-arguments). However, the linter falsely identifies a syntax error:
screen shot 2015-11-17 at 2 14 41 pm

The class works fine from my console. They keyword is required, and the class initializes when it is provided:
screen shot 2015-11-17 at 2 23 26 pm

Uncaught Error: spawn EINVAL

[Enter steps to reproduce below:]

  1. hit CMD+S in a ruby file

Atom Version: 1.5.3
System: Mac OS X 10.11.3
Thrown From: linter-ruby package, v1.2.2

Stack Trace

Uncaught Error: spawn EINVAL

At /Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:260

Error: spawn EINVAL
    at exports._errnoException (util.js:837:11)
    at ChildProcess.spawn (internal/child_process.js:298:11)
    at Object.exports.spawn (child_process.js:351:9)
    at BufferedProcess.module.exports.BufferedProcess.spawn (/Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:188:44)
    at new BufferedProcess (/Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:52:14)
    at /Users/brodock/.atom/packages/linter-ruby/node_modules/atom-linter/lib/helpers.js:152:75
    at Object.exec (/Users/brodock/.atom/packages/linter-ruby/node_modules/atom-linter/lib/helpers.js:118:10)
    at Object.exec (/Users/brodock/.atom/packages/linter-ruby/node_modules/atom-linter/lib/index.js:158:18)
    at Object.lint (/Users/brodock/.atom/packages/linter-ruby/lib/main.js:43:24)
    at promises.push.Promise.then._this.emitter.emit.linter (/Users/brodock/.atom/packages/linter/lib/linter-registry.js:63:26)
    at /Users/brodock/.atom/packages/linter/lib/linter-registry.js:62:23
    at Set.forEach (native)
    at LinterRegistry.lint (/Users/brodock/.atom/packages/linter/lib/linter-registry.js:60:18)
    at /Users/brodock/.atom/packages/linter/lib/linter.coffee:98:16
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at /Users/brodock/.atom/packages/linter/lib/editor-linter.js:30:20
    at Function.module.exports.Emitter.simpleDispatch (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:25:14)
    at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:125:28)
    at TextBuffer.module.exports.TextBuffer.saveAs (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1067:27)
    at TextBuffer.module.exports.TextBuffer.save (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:1037:19)
    at TextEditor.module.exports.TextEditor.save (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:630:26)
    at Pane.module.exports.Pane.saveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:545:18)
    at Pane.module.exports.Pane.saveActiveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:528:19)
    at Workspace.module.exports.Workspace.saveActivePaneItem (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:649:35)
    at atom-workspace.commandRegistry.add.core:save (/Applications/Atom.app/Contents/Resources/app.asar/src/register-default-commands.js:173:32)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:260:29)
    at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:536:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:359:22)
    at WindowEventHandler.module.exports.WindowEventHandler.handleDocumentKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:97:36)
    at HTMLDocument.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:3:61)

Commands

  2x -0:34.4.0 core:save (atom-text-editor.editor.vim-mode.normal-mode.is-focused)

Config

{
  "core": {
    "excludeVcsIgnoredPaths": false,
    "ignoredNames": [
      ".git",
      ".svn",
      ".DS_Store",
      ".idea",
      ".bundle"
    ],
    "projectHome": "/Users/brodock/Projetos",
    "themes": [
      "nucleus-dark-ui",
      "one-dark-syntax"
    ]
  },
  "linter-ruby": {}
}

Installed Packages

# User
No installed packages

# Dev
No dev packages

No warnings and line numbers are offset

I noticed that ever since the last update there are no longer warnings. This seems due to the move to a broader regex, as it does not identify type any longer. I think this needs to be added back in.

Additionally (on a Mac anyways) my line numbers are offset by one. If the error was on line 376, the linter is telling me the error is on line 377, despite the fact that running ruby -cw in the terminal on the same file provides correct line numbers.

I'm going to see if I have time to put in my own PR to fix it but I thought I would formally inform the community.

No linting occurs

I've installed & uninstalled linters (both the Atom linter & linter-ruby), as well as Atom itself, but I still cannot get the linter to catch any errors.

screenshot 2015-08-06 23 55 38

Obviously, running the ruby-lint gem catches this as an error, but I get nothing in the editor. The executable path is set to /Users/drew/.rvm/rubies/ruby-2.2.2/bin/ruby.

I'm having the same issue with linter-rubocop—so maybe it's any issue with Linter itself?

Thanks!

Possible false-positive - string symbol syntax

The following doesn't report any lint errors:

{ valid: 'syntax' }

But this does

{ 'valid': 'syntax' }

Both are valid and shouldn't be reported as an error.

Also, if I install the ruby-lint gem and run it against this same syntax, I don't see any errors. So I'm not sure why I'm seeing it in the Atom editor as such.

TypeError: Cannot read property 'match' of undefined

Atom Version: 1.0.7
Linter-ruby version: v1.0.2

TypeError: Cannot read property 'match' of undefined
    at TokenizedBuffer.module.exports.TokenizedBuffer.indentLevelForLine (/usr/share/atom/resources/app.asar/src/tokenized-buffer.js:680:23)
    at DisplayBuffer.module.exports.DisplayBuffer.indentLevelForLine (/usr/share/atom/resources/app.asar/src/display-buffer.js:820:35)
    at TextEditor.module.exports.TextEditor.indentLevelForLine (/usr/share/atom/resources/app.asar/src/text-editor.js:2250:33)
    at TextEditor.module.exports.TextEditor.indentationForBufferRow (/usr/share/atom/resources/app.asar/src/text-editor.js:2222:19)
    at Object.module.exports.Helpers.rangeFromLineNumber (/home/foo/.atom/packages/linter-ruby/node_modules/atom-linter/lib/helpers.coffee:131:31)
    at /home/foo/.atom/packages/linter-ruby/lib/main.js:53:30
    at Array.forEach (native)
    at /home/foo/.atom/packages/linter-ruby/lib/main.js:47:33

utf-8 strings and unexpected end-of-input

Hi!

Every method call with utf-8 string as argument ends with following error:
unexpected end-of-input, expecting keyword_end

ruby -wc returns Syntax OK.

Simple code to reproduce this:

def my_method
  puts 'привет'  # utf-8 string
end

Atom version: 1.12.6
linter-ruby version: 1.2.4
System: macOS 10.12.1
Ruby versions: 2.1.10, 2.2.3, 2.3.3

Improve visibility of syntax errors

Currently the normal errors are easy to see, but syntax errors are almost invisible.

Great if syntax errors could get the same prominence as warnings.

Normal error

image

Syntax error

image

Package.getActivationCommands is deprecated.

Use activationCommands instead of activationEvents in your package.json
Commands should be grouped by selector as follows:

  "activationCommands": {
    "atom-workspace": ["foo:bar", "foo:baz"],
    "atom-text-editor": ["foo:quux"]
  }
Package.getActivationCommands (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:790:9)
Package.hasActivationCommands (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:715:20)
<unknown> (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:169:24)
Package.measure (/Applications/Atom.app/Contents/Resources/app.asar/src/package.js:147:15)

Config.unobserve is deprecated.

Config::unobserve no longer does anything. Call .dispose() on the object returned by Config::observe instead.

Config.unobserve (/Applications/Atom.app/Contents/Resources/app/src/config.js:1045:19)
LinterRuby.destroy (/Users/angelbotto/.atom/packages/linter-ruby/lib/linter-ruby.coffee:30:16)

Failed to activate the linter-ruby package

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.7.2
System: Unknown Windows Version
Thrown From: linter-ruby package, v1.2.2

Stack Trace

Failed to activate the linter-ruby package

At Unexpected token ILLEGAL

SyntaxError: Unexpected token ILLEGAL
    at Module._compile (C:\Users\CF049\AppData\Local\atom\app-1.7.2\resources\app.asar\src\native-compile-cache.js:77:42)
    at Object.defineProperty.value [as .js] (C:\Users\CF049\AppData\Local\atom\app-1.7.2\resources\app.asar\src\compile-cache.js:208:21)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (C:\Users\CF049\AppData\Local\atom\app-1.7.2\resources\app.asar\src\native-compile-cache.js:50:27)
    at Package.module.exports.Package.requireMainModule (C:\Users\CF049\AppData\Local\atom\app-1.7.2\resources\app.asar\src\package.js:715:27)
    at Package.module.exports.Package.activateNow (C:\Users\CF049\AppData\Local\atom\app-1.7.2\resources\app.asar\src\package.js:173:16)
    at C:\Users\CF049\AppData\Local\atom\app-1.7.2\resources\app.asar\src\package.js:156:32
    at Package.module.exports.Package.measure (C:\Users\CF049\AppData\Local\atom\app-1.7.2\resources\app.asar\src\package.js:92:15)
    at C:\Users\CF049\AppData\Local\atom\app-1.7.2\resources\app.asar\src\package.js:149:26
    at Package.module.exports.Package.activate (C:\Users\CF049\AppData\Local\atom\app-1.7.2\resources\app.asar\src\package.js:146:34)
    at PackageManager.module.exports.PackageManager.activatePackage (C:\Users\CF049\AppData\Local\atom\app-1.7.2\resources\app.asar\src\package-manager.js:538:21)
    at C:\Users\CF049\AppData\Local\atom\app-1.7.2\resources\app.asar\src\package-manager.js:519:29
    at Config.module.exports.Config.transactAsync (C:\Users\CF049\AppData\Local\atom\app-1.7.2\resources\app.asar\src\config.js:337:18)
    at PackageManager.module.exports.PackageManager.activatePackages (C:\Users\CF049\AppData\Local\atom\app-1.7.2\resources\app.asar\src\package-manager.js:514:19)
    at PackageManager.module.exports.PackageManager.activate (C:\Users\CF049\AppData\Local\atom\app-1.7.2\resources\app.asar\src\package-manager.js:497:46)
    at C:\Users\CF049\AppData\Local\atom\app-1.7.2\resources\app.asar\src\atom-environment.js:754:28

Commands

Config

{
  "core": {
    "disabledPackages": [
    ],
    "themes": [
      "one-dark-ui",
      "monokai"
    ]
  }
}

Installed Packages

# User
atom-beautify, v0.29.7
autocomplete-paths, v1.0.2
color-picker, v2.1.1
emmet, v2.4.3
file-icons, v1.7.9
git-log, v0.4.1
go-to-view, v0.3.0
highlight-column, v0.5.1
highlight-line, v0.11.1
language-haml, v0.24.0
language-slim, v0.5.0
linter, v1.11.4
linter-coffeelint, v1.1.2
linter-csslint, v1.3.2
linter-erb, v1.0.2
linter-haml, v1.2.0
linter-rubocop, v0.4.7
linter-ruby, v1.2.2
linter-sass-lint, v1.4.0
linter-slim, v1.0.0
linter-tidy, v2.1.0
minimap, v4.23.4
minimap-autohide, v0.10.1
minimap-bookmarks, v0.3.0
minimap-find-and-replace, v4.5.1
minimap-git-diff, v4.3.0
minimap-pigments, v0.2.0
monokai, v0.18.0
pigments, vundefined
regex-railroad-diagram, v0.16.0
release-notes, v0.53.0
ruby-block, v0.3.5
script, vundefined
slim-language, v2.2.0
sync-settings, v0.7.2
tabs-to-spaces, v1.0.2
tualo-git-context, v0.6.17

# Dev
No dev packages

An in-range update of eslint-plugin-import is breaking the build 🚨

Version 2.4.0 of eslint-plugin-import just got published.

Branch Build failing 🚨
Dependency eslint-plugin-import
Current Version 2.3.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As eslint-plugin-import is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • ci/circleci Your tests failed on CircleCI Details

Commits

The new version differs by 10 commits.

  • 44ca158 update utils changelog
  • a3728d7 bump eslint-module-utils to v2.1.0
  • 3e29169 bump v2.4.0
  • ea9c92c Merge pull request #737 from kevin940726/master
  • 8f9b403 fix typos, enforce type of array of strings in allow option
  • 95315e0 update CHANGELOG.md
  • 28e1623 eslint-module-utils: filePath in parserOptions (#840)
  • 2f690b4 update CI to build on Node 6+7 (#846)
  • 7d41745 write doc, add two more tests
  • dedfb11 add allow glob for rule no-unassigned-import, fix #671

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Uncaught TypeError: undefined is not a function

[Enter steps to reproduce below:]

  1. close a tab with ruby code in it.

Atom Version: 0.194.0 ⚠️ in 1.0 API Preview Mode ⚠️
System: Mac OS X 10.10.3
Thrown From: linter-ruby package, v0.1.4

Stack Trace

Uncaught TypeError: undefined is not a function

At /Users/tomwganem/.atom/packages/linter-ruby/lib/linter-ruby.coffee:30

TypeError: undefined is not a function
  at LinterRuby.destroy (/Users/tomwganem/.atom/packages/linter-ruby/lib/linter-ruby.coffee:30:17)
  at LinterView.remove (/Users/tomwganem/.atom/packages/linter/lib/linter-view.coffee:252:7)
  at /Users/tomwganem/.atom/packages/linter/lib/linter-view.coffee:124:8
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/event-kit/lib/emitter.js:82:11)
  at TextEditor.module.exports.TextEditor.destroyed (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:279:27)
  at TextEditor.module.exports.Model.destroy (/Applications/Atom.app/Contents/Resources/app.asar/src/model.js:45:58)
  at Pane.module.exports.Pane.destroyItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:444:18)
  at Pane.module.exports.Pane.destroyActiveItem (/Applications/Atom.app/Contents/Resources/app.asar/src/pane.js:419:12)
  at Workspace.module.exports.Workspace.destroyActivePaneItem (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:582:35)
  at Workspace.module.exports.Workspace.destroyActivePaneItemOrEmptyPane (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace.js:621:21)
  at atom-workspace.atom.commands.add.core:close (/Applications/Atom.app/Contents/Resources/app.asar/src/workspace-element.js:307:30)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:238:29)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:519:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:354:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:178:20)

Commands

  3x -5:16 core:backspace (atom-text-editor.editor.mini)
     -4:20.5.0 editor:toggle-line-comments (atom-text-editor.editor.is-focused)
     -0:41.6.0 application:add-project-folder (atom-text-editor.editor.is-focused)
     -0:31.7.0 fuzzy-finder:toggle-file-finder (atom-text-editor.editor.is-focused)
     -0:22 find-and-replace:show (atom-text-editor.editor.is-focused)
  2x -0:20 core:backspace (atom-text-editor.editor.mini)
     -0:18.7.0 fuzzy-finder:toggle-file-finder (atom-text-editor.editor.mini)
  7x -0:16 core:backspace (atom-text-editor.editor.mini)
     -0:05.8.0 pane:split-left (atom-text-editor.editor.is-focused)
     -0:02.0 core:close (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "monokai"
    ],
    "disabledPackages": [
      "vim-mode",
      "git-plus",
      "Zen",
      "git-difftool",
      "tabular",
      "autoclose-html",
      "minimap-color-highlight",
      "terminal-panel",
      "regex-railroad-diagram",
      "git-show",
      "symbols-view"
    ]
  }
}

Installed Packages

# User
angularjs, v0.1.0
atom-ctags, v3.1.0
autocomplete-paths, v1.0.2
autocomplete-plus, v2.12.0
autocomplete-ruby, v0.1.0
editor-stats, v0.17.0
git-diff-popup, v0.1.2
language-jade, v0.4.0
last-cursor-position, v0.8.0
linter, v0.12.1
linter-ruby, v0.1.4
minimap, v4.7.6
minimap-git-diff, v4.1.2
monokai, v0.14.0
ruby-block, v0.3.3
todo-show, v0.8.0

# Dev
No dev packages

Linter Not Activating

I'm new to the Atom community so I apologize in advance if I fail to follow guidelines.

I have a fresh copy of Atom installed on OSX, and I've just installed the linter-ruby package.

I have linter-ruby v1.2.3, and linter v1.11.18 installed.

When I open a Ruby file (extension .rb and showing 'Ruby' as the language in the lower right corner), if I make an obvious syntax exception the linter doesn't trigger and the lower left hand corner says "No Issues"

If I run ruby -wc in the terminal on the same file, it catches the syntax error and outputs it to the terminal.

Clearly I must be doing something wrong as it appears the linter is not triggering automatically on my files. What can I do to debug this further or resolve what the problem might be?

LinterRuby.Linter is deprecated.

AtomLinter v0.X.Y API has been deprecated. Please refer to the Linter docs to update and the latest API: https://github.com/AtomLinter/Linter/wiki/Migrating-to-the-new-API

LinterRuby.Linter - /home/foo/.atom/packages/linter/lib/linter.coffee:60:4
new LinterRuby - /home/foo/.atom/packages/linter-ruby/lib/linter-ruby.coffee:24:4
Object.lint - /home/foo/.atom/packages/linter/lib/legacy.coffee:61:21
<unknown> - /home/foo/.atom/packages/linter/lib/editor-linter.coffee:68:23
<unknown> - /home/foo/.atom/packages/linter/lib/editor-linter.coffee:67:24
Set.forEach - native

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.