Changeset - 3c997bc6d380
[Not reviewed]
default
0 11 1
Drew Perttula - 7 years ago 2018-05-24 06:54:58
drewp@bigasterisk.com
fix some coffee lint
Ignore-this: 1a988be1598dda76dd2fefca3b499aa0
8 files changed with 163 insertions and 20 deletions:
0 comments (0 inline, 0 general)
coffeelint.json
Show inline comments
 
new file 100644
 
{
 
  "arrow_spacing": {
 
    "level": "ignore"
 
  },
 
  "braces_spacing": {
 
    "level": "ignore",
 
    "spaces": 0,
 
    "empty_object_spaces": 0
 
  },
 
  "camel_case_classes": {
 
    "level": "error"
 
  },
 
  "coffeescript_error": {
 
    "level": "error"
 
  },
 
  "colon_assignment_spacing": {
 
    "level": "ignore",
 
    "spacing": {
 
      "left": 0,
 
      "right": 0
 
    }
 
  },
 
  "cyclomatic_complexity": {
 
    "level": "ignore",
 
    "value": 10
 
  },
 
  "duplicate_key": {
 
    "level": "error"
 
  },
 
  "empty_constructor_needs_parens": {
 
    "level": "ignore"
 
  },
 
  "ensure_comprehensions": {
 
    "level": "warn"
 
  },
 
  "eol_last": {
 
    "level": "ignore"
 
  },
 
  "indentation": {
 
    "value": 2,
 
    "level": "error"
 
  },
 
  "line_endings": {
 
    "level": "ignore",
 
    "value": "unix"
 
  },
 
  "max_line_length": {
 
    "value": 80,
 
    "level": "error",
 
    "limitComments": true
 
  },
 
  "missing_fat_arrows": {
 
    "level": "ignore",
 
    "is_strict": false
 
  },
 
  "newlines_after_classes": {
 
    "value": 3,
 
    "level": "ignore"
 
  },
 
  "no_backticks": {
 
    "level": "warn"
 
  },
 
  "no_debugger": {
 
    "level": "warn",
 
    "console": false
 
  },
 
  "no_empty_functions": {
 
    "level": "ignore"
 
  },
 
  "no_empty_param_list": {
 
    "level": "ignore"
 
  },
 
  "no_implicit_braces": {
 
    "level": "ignore",
 
    "strict": true
 
  },
 
  "no_implicit_parens": {
 
    "level": "ignore",
 
    "strict": true
 
  },
 
  "no_interpolation_in_single_quotes": {
 
    "level": "ignore"
 
  },
 
  "no_nested_string_interpolation": {
 
    "level": "warn"
 
  },
 
  "no_plusplus": {
 
    "level": "ignore"
 
  },
 
  "no_private_function_fat_arrows": {
 
    "level": "warn"
 
  },
 
  "no_stand_alone_at": {
 
    "level": "ignore"
 
  },
 
  "no_tabs": {
 
    "level": "error"
 
  },
 
  "no_this": {
 
    "level": "ignore"
 
  },
 
  "no_throwing_strings": {
 
    "level": "error"
 
  },
 
  "no_trailing_semicolons": {
 
    "level": "error"
 
  },
 
  "no_trailing_whitespace": {
 
    "level": "error",
 
    "allowed_in_comments": false,
 
    "allowed_in_empty_lines": true
 
  },
 
  "no_unnecessary_double_quotes": {
 
    "level": "ignore"
 
  },
 
  "no_unnecessary_fat_arrows": {
 
    "level": "warn"
 
  },
 
  "non_empty_constructor_needs_parens": {
 
    "level": "ignore"
 
  },
 
  "prefer_english_operator": {
 
    "level": "ignore",
 
    "doubleNotLevel": "ignore"
 
  },
 
  "space_operators": {
 
    "level": "ignore"
 
  },
 
  "spacing_after_comma": {
 
    "level": "ignore"
 
  },
 
  "transform_messes_up_line_numbers": {
 
    "level": "warn"
 
  }
 
}
light9/web/graph.coffee
Show inline comments
 
@@ -28,7 +28,9 @@ class Handler
 
  
 
class AutoDependencies
 
  constructor: () ->
 
    @handlers = new Handler(null) # tree of all known Handlers (at least those with non-empty patterns). Top node is not a handler.
 
    # tree of all known Handlers (at least those with non-empty
 
    # patterns). Top node is not a handler.
 
    @handlers = new Handler(null)
 
    @handlerStack = [@handlers] # currently running
 
    
 
  runHandler: (func, label) ->
 
@@ -151,7 +153,7 @@ class window.SyncedGraph
 
    # if we had a Store already, this lets N3.Store free all its indices/etc
 
    @graph = N3.Store()
 
    @_addPrefixes(@prefixes)
 
    @cachedFloatValues = new Map();
 
    @cachedFloatValues = new Map()
 

	
 
  _clearGraphOnNewConnection: -> # must not send a patch to the server!
 
    log('graph: clearGraphOnNewConnection')
 
@@ -323,11 +325,13 @@ class window.SyncedGraph
 
      firsts = @graph.getQuads(current, RDF + 'first', null)
 
      rests = @graph.getQuads(current, RDF + 'rest', null)
 
      if firsts.length != 1
 
        throw new Error("list node #{current} has #{firsts.length} rdf:first edges")
 
        throw new Error(
 
          "list node #{current} has #{firsts.length} rdf:first edges")
 
      out.push(firsts[0].object)
 

	
 
      if rests.length != 1
 
        throw new Error("list node #{current} has #{rests.length} rdf:rest edges")
 
        throw new Error(
 
          "list node #{current} has #{rests.length} rdf:rest edges")
 
      current = rests[0].object
 
    
 
    return out
light9/web/rdfdbclient.coffee
Show inline comments
 
@@ -52,7 +52,8 @@ parseJsonPatch = (jsonPatch, cb) ->
 

	
 
class window.RdfDbClient
 
  # Send and receive patches from rdfdb
 
  constructor: (@patchSenderUrl, @clearGraphOnNewConnection, @applyPatch, @setStatus) ->
 
  constructor: (@patchSenderUrl, @clearGraphOnNewConnection, @applyPatch,
 
                @setStatus) ->
 
    @_patchesToSend = []
 
    @_lastPingMs = -1
 
    @_patchesReceived = 0
light9/web/timeline/adjustable.coffee
Show inline comments
 
@@ -110,7 +110,8 @@ class window.AdjustableFloatObject exten
 
    @ctor2()
 
    if not @config.ctx?
 
      throw new Error("missing ctx")
 
    @config.graph.runHandler(@_syncValue.bind(@), "adj sync #{@config.subj.value}")
 
    @config.graph.runHandler(@_syncValue.bind(@),
 
                             "adj sync #{@config.subj.value}")
 

	
 
  _syncValue: () ->
 
    @_currentValue = @config.graph.floatValue(@config.subj, @config.pred)
 
@@ -160,7 +161,7 @@ class window.AdjustableFade extends Adju
 
    # pos is vec2 of pixels relative to the drag start
 
    super(pos)
 
    graph = @note.graph
 
    U = (x) => graph.Uri(x)
 
    U = (x) -> graph.Uri(x)
 

	
 
    goalCenterSec = @note.zoomInX.invert(@initialTarget.e(1) + pos.e(1))
 

	
light9/web/timeline/adjusters.coffee
Show inline comments
 
@@ -40,7 +40,8 @@ coffeeElementSetup(class AdjustersCanvas
 
    pos = $V([ev.x, ev.y])
 
    if @currentDrag
 
      @currentDrag.cur = pos
 
      @currentDrag.adj.continueDrag(@currentDrag.cur.subtract(@currentDrag.start))
 
      @currentDrag.adj.continueDrag(
 
        @currentDrag.cur.subtract(@currentDrag.start))
 

	
 
  onUp: (ev) ->
 
    return unless @currentDrag
light9/web/timeline/drawing.coffee
Show inline comments
 
@@ -22,14 +22,14 @@ window.Drawing.roundRect = (ctx, sx,sy,e
 
    d2r = Math.PI/180
 
    r = ( ( ex - sx ) / 2 ) if ( ex - sx ) - ( 2 * r ) < 0 # ensure that the radius isn't too large for x
 
    r = ( ( ey - sy ) / 2 ) if ( ey - sy ) - ( 2 * r ) < 0 # ensure that the radius isn't too large for y
 
    ctx.beginPath();
 
    ctx.moveTo(sx+r,sy);
 
    ctx.lineTo(ex-r,sy);
 
    ctx.arc(ex-r,sy+r,r,d2r*270,d2r*360,false);
 
    ctx.lineTo(ex,ey-r);
 
    ctx.arc(ex-r,ey-r,r,d2r*0,d2r*90,false);
 
    ctx.lineTo(sx+r,ey);
 
    ctx.arc(sx+r,ey-r,r,d2r*90,d2r*180,false);
 
    ctx.lineTo(sx,sy+r);
 
    ctx.arc(sx+r,sy+r,r,d2r*180,d2r*270,false);
 
    ctx.closePath();
 
  ctx.beginPath()
 
  ctx.moveTo(sx+r,sy)
 
  ctx.lineTo(ex-r,sy)
 
  ctx.arc(ex-r,sy+r,r,d2r*270,d2r*360,false)
 
  ctx.lineTo(ex,ey-r)
 
  ctx.arc(ex-r,ey-r,r,d2r*0,d2r*90,false)
 
  ctx.lineTo(sx+r,ey)
 
  ctx.arc(sx+r,ey-r,r,d2r*90,d2r*180,false)
 
  ctx.lineTo(sx,sy+r)
 
  ctx.arc(sx+r,sy+r,r,d2r*180,d2r*270,false)
 
  ctx.closePath()
light9/web/timeline/timeline.coffee
Show inline comments
 
@@ -641,4 +641,4 @@ class Note
 
    #elem = @getOrCreateElem(uri+'/label', 'noteLabels', 'text', {style: "font-size:13px;line-height:125%;font-family:'Verana Sans';text-align:start;text-anchor:start;fill:#000000;"})
 
    #elem.setAttribute('x', curvePts[0].e(1)+20)
 
    #elem.setAttribute('y', curvePts[0].e(2)-10)
 
    #elem.innerHTML = effectLabel;
 
    #elem.innerHTML = effectLabel
package.json
Show inline comments
 
@@ -14,6 +14,7 @@
 
    "bower": "^1.8.4",
 
    "browserify": "^16.2.0",
 
    "chai": "^3.5.0",
 
    "coffeelint": "^2.1.0",
 
    "coffeescript": "^2.3.0",
 
    "d3": "^5.1.0",
 
    "mocha": "^2.5.3",
0 comments (0 inline, 0 general)