yujinakayama / atom-lint

Obsolete: Generic code linting support for Atom
https://atom.io/packages/atom-lint
MIT License
111 stars 33 forks source link

Uncaught TypeError: Cannot read property 'offenses' of undefined #129

Closed johnathanludwig closed 9 years ago

johnathanludwig commented 9 years ago

I upgraded Rubocop from 0.27.1 to 0.29.1 and this error started happening.

  1. Use Rubocop 0.29.1

Atom Version: 0.178.0 System: Mac OS X 10.10.2 Thrown From: atom-lint package, v0.20.1

Stack Trace

Uncaught TypeError: Cannot read property 'offenses' of undefined

At /Users/bumontherun/.atom/packages/atom-lint/lib/linter/rubocop.coffee:18

TypeError: Cannot read property 'offenses' of undefined
  at /Users/bumontherun/.atom/packages/atom-lint/lib/linter/rubocop.coffee:18:24
  at /Users/bumontherun/.atom/packages/atom-lint/lib/linter/rubocop.coffee:54:9
  at ChildProcess.<anonymous> (/Users/bumontherun/.atom/packages/atom-lint/lib/command-runner.coffee:32:7)
  at ChildProcess.emit (events.js:119:17)
  at maybeClose (child_process.js:1013:16)
  at Process.ChildProcess._handle.onexit (child_process.js:1085:5)

Commands

     -2:24.6 fuzzy-finder:toggle-file-finder (ul.list-inline.tab-bar.inset-panel)
     -2:23.3 core:confirm (atom-text-editor.editor.mini)
     -2:15.8 find-and-replace:show (atom-text-editor.editor)
     -2:14.0 core:backspace (atom-text-editor.editor.mini)
     -2:12.9 core:confirm (atom-text-editor.editor.mini)
     -2:01.8 fuzzy-finder:toggle-file-finder (atom-text-editor.editor)
     -1:59.2 core:move-down (atom-text-editor.editor.mini)
     -1:58.9 core:confirm (atom-text-editor.editor.mini)
     -1:56.0 core:backspace (atom-text-editor.editor)
     -1:39.7 find-and-replace:show (atom-text-editor.editor)
     -1:38.1 core:backspace (atom-text-editor.editor.mini)
     -1:37.6 core:confirm (atom-text-editor.editor.mini)
     -1:34.6 cut-line:paste-line (atom-text-editor.editor)
     -0:07.2 fuzzy-finder:toggle-file-finder (atom-text-editor.editor)
     -0:04.0 core:confirm (atom-text-editor.editor.mini)

Config

{
  "core": {
    "followSymlinks": true,
    "disabledPackages": [
      "minimap-git-diff",
      "wrap-guide",
      "metrics",
      "autocomplete-snippets",
      "autocomplete-paths",
      "linter-ruby",
      "linter",
      "linter-rubocop",
      "file-icons",
      "autocomplete-plus"
    ],
    "themes": [
      "seti-ui",
      "seti-syntax"
    ]
  },
  "atom-lint": {
    "ignoredNames": [
      "tmp/**",
      "db/schema.rb"
    ],
    "rubocop": {
      "path": "/usr/local/var/rbenv/shims/rubocop"
    },
    "coffeelint": {
      "path": "/usr/local/bin/coffeelint"
    },
    "jshint": {
      "path": "/usr/local/lib/node_modules/jshint/bin/jshint"
    }
  }
}

Installed Packages

# User
atom-lint, v0.20.1
cut-line, v0.10.0
dash, v1.0.2
editor-stats, v0.17.0
language-haml, v0.15.0
language-liquid, v0.2.0
pain-split, v1.3.1
pretty-json, v0.3.2
project-manager, v1.15.5
related-files, v0.3.0
ruby-string-interpolation, v0.1.8
ruby-syntax-replacer, v0.3.1
seti-syntax, v0.3.3
seti-ui, v0.6.3
toggle-quotes, v0.10.0
tree-view-open-files, v0.2.3

# Dev
No dev packages
johnathanludwig commented 9 years ago

Sorry. This turned out to be a change in rubocop removing support for something in our config. I thought I had retested atom-lint after updating our config.

ahmetabdi commented 9 years ago

I still get this on an empty file

  1. Create a new file
  2. Save the file

Atom Version: 0.187.0 System: Mac OS X 10.9.4 Thrown From: atom-lint package, v0.20.1

Stack Trace

Uncaught TypeError: Cannot read property 'offenses' of undefined

At /Users/ahmet/.atom/packages/atom-lint/lib/linter/rubocop.coffee:18

TypeError: Cannot read property 'offenses' of undefined
  at /Users/ahmet/.atom/packages/atom-lint/lib/linter/rubocop.coffee:18:24
  at /Users/ahmet/.atom/packages/atom-lint/lib/linter/rubocop.coffee:54:9
  at ChildProcess.<anonymous> (/Users/ahmet/.atom/packages/atom-lint/lib/command-runner.coffee:32:7)
  at ChildProcess.emit (events.js:119:17)
  at maybeClose (child_process.js:1013:16)
  at Socket.<anonymous> (child_process.js:1181:11)
  at Socket.emit (events.js:116:17)
  at Pipe.close (net.js:477:12)

Commands

     -2:56.0 core:confirm (atom-text-editor.editor.mini)
     -2:35.0 core:close (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-monokai.theme-flatland-dark-ui)
     -2:34.3 pane:show-item-3 (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-monokai.theme-flatland-dark-ui)
     -2:30.0 spec-maker:open-or-create-spec (atom-text-editor.editor)
     -2:20.8 core:close (atom-text-editor.editor.is-focused)
  2x -2:11.8 core:confirm (atom-text-editor.editor.mini)
     -1:17.6 core:close (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-monokai.theme-flatland-dark-ui)
     -1:01.9 core:confirm (atom-text-editor.editor.mini)
     -0:57.5 core:select-all (atom-text-editor.editor.mini)
     -0:56.8 core:confirm (atom-text-editor.editor.mini)
     -0:27.2 pane:show-item-1 (atom-workspace.workspace.scrollbars-visible-when-scrolling.theme-monokai.theme-flatland-dark-ui)
     -0:24.8 rails-rspec:toggle-spec-file (atom-text-editor.editor)
     -0:10.7 core:close (atom-text-editor.editor.is-focused)
     -0:08.1 rails-rspec:toggle-spec-file (atom-text-editor.editor)
     -0:05.1 core:close (atom-text-editor.editor.is-focused)
     -0:01.8 rails-rspec:toggle-spec-file (atom-text-editor.editor)

Config

{
  "core": {
    "projectHome": "/Users/ahmet/Projects",
    "disabledPackages": [
      "atom-bitcoin",
      "atom-ctags",
      "linter"
    ],
    "themes": [
      "flatland-dark-ui",
      "monokai"
    ],
    "ignoredNames": [
      ".DS_Store",
      "tmp",
      ".keep",
      ".git",
      "tags",
      "config.ru",
      "Gemfile.lock",
      "Rakefile",
      "vendor",
      "public",
      "log",
      "bin",
      ".capistrano",
      ".gitkeep",
      "*.caching",
      "script",
      "docs",
      ""
    ]
  },
  "atom-lint": {}
}

Installed Packages

# User
atom-beautify, v0.22.3
atom-lint, v0.20.1
autocomplete-plus, v2.5.0
autocomplete-ruby, v0.0.1
file-icons, v1.5.1
flatland-dark-ui, v0.2.3
highlight-line, v0.10.1
highlight-selected, v0.9.1
language-rspec, v0.3.0
linter-rubocop, v0.2.2
linter-ruby, v0.1.4
monokai, v0.12.0
pain-split, v1.3.1
rails-rspec, v0.3.1
rspec, v0.1.9
symbol-gen, v0.2.0
tabs-to-spaces, v0.8.1
travis-ci-status, v0.13.0

# Dev
No dev packages