 fs = require 'fs'
 {$, $$, SelectListView} = require 'atom'
 
+# Basic flake8 parsing tool with callback functionality
 flake = (filePath, callback) ->
   line_expr = /:(\d+):(\d+): ([CEFW]\d{3}) (.*)/
   errors = []
   currentIndex = -1
-  skipLine = false
+  skip_line = false
 
   params = ["--show-source", filePath]
   ignoreErrors = atom.config.get "flake8.ignoreErrors"

    return unless editor?
    return unless editor.getGrammar().name == 'Python'

    @storeFocusedElement()
    filePath = editor.getPath()

    @setLoading('Running Flake8 Lint...')
    atom.workspaceView.append(this)
    @focusFilterEditor()


        else
          message = error.message
        # console.log(message)
        error_list.push(error)

      @setItems(error_list)

    # if @previouslyFocusedElement[0] and @previouslyFocusedElement[0] isnt document.body
    #   @eventElement = @previouslyFocusedElement
    # else
    #   @eventElement = atom.workspaceView

  viewForItem: (error) ->
    if error.type
      base_msg = error.type + ' - ' + error.message
    else
      base_msg = error.message
    $$ ->
      @li class: 'event', 'data-event-name': error.type, =>
        @div class: 'pull-right', =>
            # Use the keybinding class to display line numbers
            @kbd "Line: " + error.line, class: 'key-binding'
        @span base_msg[0..65], title: error.message

  confirmed: (error) ->
    @cancel()
    if error
      editor = atom.workspace.getActiveEditor()
      line = error.line
      pos = error.position
    editor.cursors[0].setBufferPosition([line, pos], options={'autoscroll': true})
