Skip to content

Commit

Permalink
Merge pull request #80 from mrjoelkemp/exclusions
Browse files Browse the repository at this point in the history
Support paths and files to exclude
  • Loading branch information
mrjoelkemp committed Dec 21, 2014
2 parents af279dd + f9d0e8e commit 0d9379f
Show file tree
Hide file tree
Showing 243 changed files with 1,341 additions and 137,298 deletions.
3 changes: 3 additions & 0 deletions Dependents.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ def get_dependents(self):
if self.window.config:
args['config'] = self.view.path + self.window.config

if self.window.exclude:
args['exclude'] = ','.join(self.window.exclude)

fetch_time = time.time()

# Newline in output is an empty dependent
Expand Down
18 changes: 18 additions & 0 deletions changelogs/2.3.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
New Feature: Exclude files and folders
----

Now you can exclude specific files and folder names from the search for dependents.

If you're using the plugin in a large codebase, this can shave off a few seconds.


To use this, add the following setting to Preferences -> Package Settings -> Dependents -> Settings - User

"exclude": [
"jquery.js",
"someOtherFile.js",
"plugins/"
]

Note: The trailing slash is not required for indicating that a name is of a directory.

16 changes: 10 additions & 6 deletions changelogs/initial.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
Configuring settings
---

* You need to supply the "root" of your JS codebase (i.e., the location where your JS files reside).
* You may also supply the location of your RequireJS configuration for AMD codebases
* You may also supply the location of your SASS files.

These can be specified by going to

`Preferences -> Package Settings -> Dependents -> Settings - User`
Expand All @@ -14,10 +10,16 @@ and adding:
{
"root": "path/to/my/js",
"config": "path/to/my/requirejs/config.js", # Optional
"sass_root": "path/to/my/sass" # Optional
"sass_root": "path/to/my/sass", # Optional,
"exclude": ['jquery.js', 'plugins/'] # Optional
}

* Please modify the "root", "config", and "sass_root" values according to your codebase.
* "root": the location where your JS files reside
* "config": the location of your RequireJS configuration for AMD codebases
* "sass_root": the location of your SASS files
* "exclude": a list of files and folder names to exclude in the search for dependents

* Please modify the values according to your codebase.

---
Default key bindings
Expand All @@ -37,3 +39,5 @@ Menu Options
You can find other features of this plugin from:

File -> Dependents

Or by right clicking on a file and going to the Dependents menu
1 change: 1 addition & 0 deletions command_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def _init(self):
self.window.root = settings['root']
self.window.sass_root = settings['sass_root']
self.window.config = settings['config']
self.window.exclude = settings['exclude']

if self.window.root == './' or self.window.root == '.':
self.window.root = base_path
Expand Down
3 changes: 2 additions & 1 deletion messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
"2.1.0": "changelogs/2.1.0.txt",
"2.1.1": "changelogs/2.1.1.txt",
"2.1.2": "changelogs/2.1.2.txt",
"2.2.0": "changelogs/2.2.0.txt"
"2.2.0": "changelogs/2.2.0.txt",
"2.3.0": "changelogs/2.3.0.txt"
}
7 changes: 7 additions & 0 deletions node_dependents.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,15 @@ def get_dependents(options):
except:
p('Dependents: Config not supplied')

try:
if options['exclude']:
args.append(options['exclude'])
except:
p('Dependents: exclude list not supplied')

return exec_script('dependents.js', args).split('\n')


def alias_lookup(options):
try:
args = [options['config'], options['module']]
Expand Down
1 change: 1 addition & 0 deletions node_modules/dependents/.npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 4 additions & 14 deletions node_modules/dependents/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions node_modules/dependents/bin/dependencyLookup.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

162 changes: 95 additions & 67 deletions node_modules/dependents/bin/dependents.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0d9379f

Please sign in to comment.