Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

lint fixes

  • Loading branch information...
commit 2f68924959a750e70a77645b3a51b6e15c44daa6 1 parent 9819486
Brendan Adamson authored February 20, 2012
35  etc/coffeelint.json
... ...
@@ -0,0 +1,35 @@
  1
+{
  2
+  "no_tabs" : {
  3
+    "level" : "error"
  4
+  },
  5
+  "no_trailing_whitespace" : {
  6
+    "level" : "error"
  7
+  },
  8
+  "max_line_length" : {
  9
+    "value": 80,
  10
+    "level" : "error"
  11
+  },
  12
+  "camel_case_classes" : {
  13
+    "level" : "error"
  14
+  },
  15
+  "indentation" : {
  16
+    "value" : 2,
  17
+    "level" : "error"
  18
+  },
  19
+  "no_implicit_braces" : {
  20
+    "level" : "ignore"
  21
+  },
  22
+  "no_trailing_semicolons" : {
  23
+    "level" : "error"
  24
+  },
  25
+  "no_plusplus" : {
  26
+    "level" : "error"
  27
+  },
  28
+  "no_throwing_strings" : {
  29
+    "level" : "error"
  30
+  },
  31
+  "cyclomatic_complexity" : {
  32
+    "value" : 11,
  33
+    "level" : "warn"
  34
+  }
  35
+}
2  rakefile
@@ -11,7 +11,7 @@ task :default => :test
11 11
 
12 12
 desc "run coffeelint"
13 13
 task :coffeelint do
14  
-    sh "find src test -name '*.coffee' | xargs coffeelint"
  14
+    sh "find lib test -name '*.coffee' | xargs node_modules/.bin/coffeelint -f etc/coffeelint.json"
15 15
 end
16 16
 
17 17
 desc "run vows tests"
9  test/v4/testArtist.coffee
@@ -107,10 +107,12 @@ vows.describe('artist methods').addBatch({
107 107
         # artists is a list, but obj in doc
108 108
         assert.ok response.artists[0].name.length > 0
109 109
       'we see no errors': checkErrors
110  
-    "to extract names from 'behold... the arctopus pickle beatles computer jesus refrigerator'":
  110
+    "to extract names from 'behold... the arctopus pickle beatles
  111
+        computer jesus refrigerator'":
111 112
       topic: (nest) ->
112 113
         nest.artist.extract {
113  
-          text: 'behold... the arctopus pickle beatles computer jesus refrigerator'
  114
+          text: 'behold... the arctopus pickle beatles
  115
+            computer jesus refrigerator'
114 116
         }, @callback
115 117
         undefined
116 118
       'we get the beatles': (err, response) ->
@@ -193,7 +195,8 @@ vows.describe('artist methods').addBatch({
193 195
         }, @callback
194 196
         undefined
195 197
       'we get his wikipedia page': (err, response) ->
196  
-        assert.equal response.urls.wikipedia_url, 'http://en.wikipedia.org/wiki/Justin_Bieber'
  198
+        assert.equal response.urls.wikipedia_url,
  199
+          'http://en.wikipedia.org/wiki/Justin_Bieber'
197 200
       'we see no errors': checkErrors
198 201
     "to search for justin bieber video":
199 202
       topic: (nest) ->
4  test/v4/testCatalog.coffee
@@ -39,7 +39,9 @@ vows.describe('catalog methods').addBatch({
39 39
               id: id
40 40
             }, callback
41 41
           # get ids of just test catalogs
42  
-          ids = (catalog.id for catalog in response.catalogs when /test catalog/.test(catalog.name))
  42
+          isTestCatalog = (name) -> /test catalog/.test(name)
  43
+          ids = for catalog in response.catalogs when isTestCatalog catalog.name
  44
+            catalog.id
43 45
           deletes = {}
44 46
           for id in ids
45 47
             deletes[id] = do (id) -> (callback) ->
20  test/v4/testSong.coffee
@@ -31,16 +31,28 @@ vows.describe('song methods').addBatch({
31 31
       'we see no errors': checkErrors
32 32
     "to post to identify with a fingerprint":
33 33
       topic: (nest) ->
34  
-        # fingerprint code taken from http://developer.echonest.com/docs/v4/song.html#identify
  34
+        # fingerprint code taken from
  35
+        # http://developer.echonest.com/docs/v4/song.html#identify
35 36
         # FIXME: having to encode json myself is a little crappy
36  
-        # we wouldn't have to do this if we did a get with a querystring, but these fingerprints
37  
-        # are long
  37
+        # we wouldn't have to do this if we did a get with a querystring,
  38
+        # but these fingerprints are long
38 39
         nest.song.identify {
39 40
           query:
40 41
             JSON.stringify({
41 42
               metadata:
42 43
                 artist: "Michael Jackson"
43  
-              code: "eJxVlIuNwzAMQ1fxCDL133-xo1rnGqNAEcWy_ERa2aKeZmW9ustWVYrXrl5bthn_laFkzguNWpklEmoTB74JKYZSPlbJ0sy9fQrsrbEaO9W3bsbaWOoK7IhkHFaf_ag2d75oOQSZczbz5CKA7XgTIBIXASvFi0A3W8pMUZ7FZTWTVbujCcADlQ_f_WbdRNJ2vDUwSF0EZmFvAku_CVy440fgiIvArWZZWoJ7GWd-CVTYC5FCFI8GQdECdROE20UQfLoIUmhLC7IiByF1gzbAs3tsSKctyC76MPJlHRsZ5qhSQhu_CJFcKtW4EMrHSIrpTGLFqsdItj1H9JYHQYN7W2nkC6GDPjZTAzL9dx0fS4M1FoROHh9YhLHWdRchQSd_CLTpOHkQQP3xQsA2-sLOUD7CzxU0GmHVdIxh46Oide0NrNEmjghG44Ax_k2AoDHsiV6WsiD6OFm8y-0Lyt8haDBBzeMlAnTuuGYIB4WA2lEPAWbdeOabgFN6TQMs6ctLA5fHyKMBB0veGrjPfP00IAlWNm9n7hEh5PiYYBGKQDP-x4F0CL8HkhoQnRWN997JyEpnHFR7EhLPQMZmgXS68hsHktEVErranvSSR2VwfJhQCnkuwhBUcINNY-xu1pmw3PmBqU9-8xu0kiF1ngOa8vwBSSzzNw=="
  44
+              code: "eJxVlIuNwzAMQ1fxCDL133-xo1rnGqNAEcWy_ERa2aKeZmW9ustWVYr" +
  45
+                "Xrl5bthn_laFkzguNWpklEmoTB74JKYZSPlbJ0sy9fQrsrbEaO9W3bsbaWO" +
  46
+                "oK7IhkHFaf_ag2d75oOQSZczbz5CKA7XgTIBIXASvFi0A3W8pMUZ7FZTWTV" +
  47
+                "bujCcADlQ_f_WbdRNJ2vDUwSF0EZmFvAku_CVy440fgiIvArWZZWoJ7GWd-" +
  48
+                "CVTYC5FCFI8GQdECdROE20UQfLoIUmhLC7IiByF1gzbAs3tsSKctyC76MPJ" +
  49
+                "lHRsZ5qhSQhu_CJFcKtW4EMrHSIrpTGLFqsdItj1H9JYHQYN7W2nkC6GDPj" +
  50
+                "ZTAzL9dx0fS4M1FoROHh9YhLHWdRchQSd_CLTpOHkQQP3xQsA2-sLOUD7Cz" +
  51
+                "xU0GmHVdIxh46Oide0NrNEmjghG44Ax_k2AoDHsiV6WsiD6OFm8y-0Lyt8h" +
  52
+                "aDBBzeMlAnTuuGYIB4WA2lEPAWbdeOabgFN6TQMs6ctLA5fHyKMBB0veGrj" +
  53
+                "PfP00IAlWNm9n7hEh5PiYYBGKQDP-x4F0CL8HkhoQnRWN997JyEpnHFR7Eh" +
  54
+                "LPQMZmgXS68hsHktEVErranvSSR2VwfJhQCnkuwhBUcINNY-xu1pmw3PmBq" +
  55
+                "U9-8xu0kiF1ngOa8vwBSSzzNw=="
44 56
             })
45 57
         }, @callback
46 58
         undefined
3  test/v4/testTrack.coffee
@@ -8,7 +8,8 @@ util = require '../util'
8 8
 checkErrors = util.checkErrors
9 9
 
10 10
 koenjiSong =
11  
-  filename: 'test/data/koenjihyakkei-mederro-passquirr-sample-supercompressed.mp3'
  11
+  filename:
  12
+    'test/data/koenjihyakkei-mederro-passquirr-sample-supercompressed.mp3'
12 13
   md5: '03ba8a2e60426497549218321d64829e'
13 14
   artistIncludes: "Koenji"
14 15
   titleIncludes: "Mederro"

0 notes on commit 2f68924

Please sign in to comment.
Something went wrong with that request. Please try again.