tomoya / rubocop-auto-correct

Auto-correct ruby source code by using rubocop in Atom.
https://atom.io/packages/rubocop-auto-correct
MIT License
29 stars 17 forks source link

Uncaught TypeError: Cannot read property 'match' of null #23

Open kensr400 opened 8 years ago

kensr400 commented 8 years ago

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.4.3 System: Unknown Windows Version Thrown From: rubocop-auto-correct package, v1.2.0

Stack Trace

Uncaught TypeError: Cannot read property 'match' of null

At /C:/Users/onoue/.atom/packages/rubocop-auto-correct/lib/rubocop-auto-correct.coffee:167

TypeError: Cannot read property 'match' of null
    at file:///C:/Users/onoue/.atom/packages/rubocop-auto-correct/lib/rubocop-auto-correct.coffee:112:24
    at C:\Users\onoue\.atom\packages\rubocop-auto-correct\node_modules\which\which.js:79:20
    at C:\Users\onoue\.atom\packages\rubocop-auto-correct\node_modules\which\node_modules\isexe\index.js:44:5
    at C:\Users\onoue\.atom\packages\rubocop-auto-correct\node_modules\which\node_modules\isexe\windows.js:29:5
    at FSReqWrap.oncomplete (fs.js:82:15)

Commands

  2x -9:55.5.0 editor:newline (atom-text-editor.editor.is-focused)
     -9:55.1.0 core:paste (atom-text-editor.editor.is-focused)
  5x -9:54.1.0 core:move-up (atom-text-editor.editor.is-focused)
     -9:53 core:move-right (atom-text-editor.editor.is-focused)
  6x -9:52.6.0 core:select-down (atom-text-editor.editor.is-focused)
     -9:45.4.0 rubocop-auto-correct:current-file (atom-text-editor.editor.is-focused)
     -9:32.5.0 spell-check:correct-misspelling (atom-text-editor.editor.is-focused)
     -9:28.1.0 rubocop-auto-correct:current-file (atom-text-editor.editor.is-focused)
     -6:54.2.0 window:toggle-menu-bar (div.package-detail.panels-item)
     -6:14.4.0 find-and-replace:show (div.panels-item)
     -5:56 command-palette:toggle (atom-text-editor.editor.is-focused)
     -5:50.7.0 window:toggle-menu-bar (atom-text-editor.editor)
     -5:45.4.0 command-palette:toggle (ol.tree-view.full-menu.list-tree.has-collapsable-children.focusable-panel)
     -3:21.1.0 editor:consolidate-selections (atom-text-editor.editor.mini.is-focused)
     -3:21.1.0 core:cancel (atom-text-editor.editor.mini.is-focused)
     -0:05.2.0 rubocop-auto-correct:current-file (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "monokai"
    ]
  },
  "rubocop-auto-correct": {
    "notification": false
  }
}

Installed Packages

# User
autocomplete-paths, v1.0.2
minimap, v4.19.0
minimap-autohide, v0.10.1
monokai, v0.18.0
pigments, v0.23.0
project-manager, v2.7.6
rubocop-auto-correct, v1.2.0

# Dev
No dev packages
kiyonori-matsumoto commented 8 years ago

@kensr400 I use this package on windows, same error has happened. I find that rubocop-auto-correct:current-file succesfully worked by including extentions to "rubocop command path" configuration. (ex. C:\RailsInstaller\Ruby2.2.0\bin\rubocop.bat )

@tomoya I think this error may occur because "which" command can take rubocop command without specifying extension, but "spawnSync" command needs extention to execute Windows batch files.