Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Support simple *.extension for now
Browse files Browse the repository at this point in the history
Supporting all of minimatch's features should be given more thought
and extension ignoring is the common case that really needs initial
support.
  • Loading branch information
kevinsawicki committed Mar 4, 2014
1 parent 8029a05 commit a80d265
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 4 additions & 3 deletions lib/directory.coffee
Expand Up @@ -2,7 +2,6 @@ path = require 'path'

{Model} = require 'theorist'
_ = require 'underscore-plus'
minimatch = require 'minimatch'

File = require './file'

Expand Down Expand Up @@ -63,8 +62,10 @@ class Directory extends Model
if atom.config.get('tree-view.hideIgnoredNames')
ignoredNames = atom.config.get('core.ignoredNames') ? []
ignoredNames = [ignoredNames] if typeof ignoredNames is 'string'
for ignoredName in ignoredNames
return true if minimatch(path.basename(filePath), ignoredName, dot: true)
name = path.basename(filePath)
return true if _.contains(ignoredNames, name)
extension = path.extname(filePath)
return true if extension and _.contains(ignoredNames, "*#{extension}")

false

Expand Down
3 changes: 1 addition & 2 deletions package.json
Expand Up @@ -13,7 +13,6 @@
"fs-plus": "2.x",
"temp": "~0.6.0",
"theorist": "1.x",
"underscore-plus": "1.x",
"minimatch": "^0.2.14"
"underscore-plus": "1.x"
}
}

2 comments on commit a80d265

@marioidival
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

???

@smashwilson
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen this trip up a few people now (atom/atom#1966). It's true that extension globs are the common case, but I found it a little surprising that you can't do full globbing, too. I was about to add a PR to enable it when I saw that you'd explicitly taken it out.

What was the concern here? Performance, or just avoiding dependency bloat?

Please sign in to comment.