From 590bfa0c86170057f8ab8927aef3b9cd5185f411 Mon Sep 17 00:00:00 2001 From: Desmond Brand Date: Fri, 15 Aug 2014 15:27:33 -0700 Subject: [PATCH 1/4] :lipstick: Tighten lint rules coffeelint.json had some rules set to ignore, but since #3116 was merged there are no violations of these rules in the code anymore. Tighten up the rules to prevent those kinds of errors from creeping back in. Test Plan: Lint executes without finding any errors ``` $ ./script/grunt coffeelint Running "coffeelint:src" (coffeelint) task >> 80 files lint free. Running "coffeelint:build" (coffeelint) task >> 23 files lint free. Running "coffeelint:test" (coffeelint) task >> 40 files lint free. Done, without errors. ``` --- coffeelint.json | 6 ------ src/browser/application-menu.coffee | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/coffeelint.json b/coffeelint.json index 360168898..59ae280b8 100644 --- a/coffeelint.json +++ b/coffeelint.json @@ -1,14 +1,8 @@ { - "indentation": { - "level": "ignore" - }, "max_line_length": { "level": "ignore" }, "no_empty_param_list": { "level": "error" - }, - "no_unnecessary_fat_arrows": { - "level": "ignore" } } diff --git a/src/browser/application-menu.coffee b/src/browser/application-menu.coffee index 353733f2f..a43410db2 100644 --- a/src/browser/application-menu.coffee +++ b/src/browser/application-menu.coffee @@ -116,7 +116,7 @@ class ApplicationMenu item.metadata ?= {} if item.command item.accelerator = @acceleratorForCommand(item.command, keystrokesByCommand) - item.click = => global.atomApplication.sendCommand(item.command) + item.click = -> global.atomApplication.sendCommand(item.command) item.metadata['windowSpecific'] = true unless /^application:/.test(item.command) @translateTemplate(item.submenu, keystrokesByCommand) if item.submenu template From 6b5d16173b7e82a10836af17ff925917e9741535 Mon Sep 17 00:00:00 2001 From: Desmond Brand Date: Fri, 15 Aug 2014 15:55:22 -0700 Subject: [PATCH 2/4] :lipstick: more lint rules --- coffeelint.json | 10 ++++++++++ src/atom.coffee | 2 +- src/browser/auto-update-manager.coffee | 2 +- src/token.coffee | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/coffeelint.json b/coffeelint.json index 59ae280b8..b83f0017f 100644 --- a/coffeelint.json +++ b/coffeelint.json @@ -4,5 +4,15 @@ }, "no_empty_param_list": { "level": "error" + }, + "arrow_spacing": { + "level": "warn" + }, + "line_endings": { + "level": "error", + "value": "unix" + }, + "no_interpolation_in_single_quotes": { + "level": "error" } } diff --git a/src/atom.coffee b/src/atom.coffee index ee7f7bd06..d497d1701 100644 --- a/src/atom.coffee +++ b/src/atom.coffee @@ -459,7 +459,7 @@ class Atom extends Model # # This is done in a next tick to prevent a white flicker from occurring # if called synchronously. - displayWindow: ({maximize}={})-> + displayWindow: ({maximize}={}) -> setImmediate => @show() @focus() diff --git a/src/browser/auto-update-manager.coffee b/src/browser/auto-update-manager.coffee index 12b3ab55c..01151f2a9 100644 --- a/src/browser/auto-update-manager.coffee +++ b/src/browser/auto-update-manager.coffee @@ -74,7 +74,7 @@ class AutoUpdateManager getState: -> @state - check: ({hidePopups}={})-> + check: ({hidePopups}={}) -> unless hidePopups autoUpdater.once 'update-not-available', @onUpdateNotAvailable autoUpdater.once 'error', @onUpdateError diff --git a/src/token.coffee b/src/token.coffee index cfbfaa8ea..fabf33de8 100644 --- a/src/token.coffee +++ b/src/token.coffee @@ -150,7 +150,7 @@ class Token scopeClasses = scope.split('.') _.isSubset(targetClasses, scopeClasses) - getValueAsHtml: ({hasIndentGuide})-> + getValueAsHtml: ({hasIndentGuide}) -> if @isHardTab classes = 'hard-tab' classes += ' indent-guide' if hasIndentGuide From ccd32cd08411dbac0dab2abe1607e541e06ab013 Mon Sep 17 00:00:00 2001 From: Desmond Brand Date: Fri, 15 Aug 2014 15:57:50 -0700 Subject: [PATCH 3/4] :lipstick: arrow spacing warn -> error --- coffeelint.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coffeelint.json b/coffeelint.json index b83f0017f..5d1a43952 100644 --- a/coffeelint.json +++ b/coffeelint.json @@ -6,7 +6,7 @@ "level": "error" }, "arrow_spacing": { - "level": "warn" + "level": "error" }, "line_endings": { "level": "error", From a20f04149cd8819c4902f248750a5ac7ae1768c1 Mon Sep 17 00:00:00 2001 From: Desmond Brand Date: Fri, 15 Aug 2014 17:06:43 -0700 Subject: [PATCH 4/4] remove line_endings rule --- coffeelint.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/coffeelint.json b/coffeelint.json index 5d1a43952..9535d90ac 100644 --- a/coffeelint.json +++ b/coffeelint.json @@ -8,10 +8,6 @@ "arrow_spacing": { "level": "error" }, - "line_endings": { - "level": "error", - "value": "unix" - }, "no_interpolation_in_single_quotes": { "level": "error" }