       type: 'boolean'
       default: true
 
+  #
+  # PROPS
+  #
+
   subscriptions: null
-  showNotifications: true
+
+  #
+  # PUBLIC
+  #
 
   activate: (state) ->
     # Events subscribed to in atom's system can be easily cleaned up with a CompositeDisposable


{CompositeDisposable} = require 'atom'

class Comb

  config:
    shouldNotSearchConfig:

    @subscriptions.dispose()

  comb: ->
    filePath = atom.workspace.getActivePaneItem().getPath()
    config = @_getConfig(filePath)

    @_processFile(filePath, config)

  #
  # PRIVATE
  #

  _processFile: (filePath, config) ->
    comb = new CSScomb(config)
    comb.processFile(filePath)

    if @_showNotifications()
      atom.notifications.addInfo('File processed by csscomb')

  _showNotifications: ->
    atom.config.get('css-comb.showNotifications') && atom.notifications && atom.notifications.addInfo

  _getConfig: (filePath) ->
    if !atom.config.get('css-comb.shouldNotSearchConfig')
      configPath = path.join(path.dirname(filePath), '.csscomb.json')
      configPath = CSScomb.getCustomConfigPath(configPath)

    if configPath
      return require(configPath)
    else
      configPath = atom.config.get('css-comb.customConfig')

      if configPath && fs.existsSync(configPath)
        return require(configPath)
      else
        return CSScomb.getConfig(atom.config.get('css-comb.predef'))
