robcowie / SublimeTODO

**[DEPRECATED]** - See https://github.com/jonathandelgado/SublimeTodoReview - Extract TODO-type comments from open files and project folders
295 stars 54 forks source link

User specific file/folder exclusions #12

Closed lennart closed 12 years ago

lennart commented 12 years ago

In order to exclude folders and files from crawling, this pull request allows you to specify a list of folders and/or files in the following manner.

In your Base File.sublime-settings (User overrides)

{
    "todo": {
      "folder_exclude_patterns": [
        "vendor",
        "log",
        "tmp",
        ".bundle",
        "public",
        "doc"
      ],
      "file_exclude_patterns": ["*.css"]
    }
}

as well as your project specific configurations e.g. My Project.sublime-project

{
  "folders": [
    {
      "path": "/Users/awesome/Projects/foo"
    }
  ],
  "settings" : {
    "todo": {
      "folder_exclude_patterns": [
        "vendor",
        "log",
        "tmp",
        ".bundle",
        "public",
        "doc"
      ],
      "file_exclude_patterns": ["*.css"]
    }
  }
}

This way you can have separate exclusions for TODOs (like suggested in #11) and still honour the global excludes like .git and .svn

robcowie commented 12 years ago

Cheers for this. I'll get to it at the weekend in a couple of days. Rob

akavlie commented 12 years ago

Yes please. I've got a huge bunch of JS, and SublimeTODO gives me bunches of TODOs from third-party code that I don't care about. Need this!!

lennart commented 12 years ago

careful with this pull request, since a recent development version of Sublime, they merged the File and Base Settings, I'll have to recheck whether everything still works as expected!

robcowie commented 12 years ago

Shouldn't be a problem in the short term. The changes are in the dev channel for now I think? We'll handle migration when the changes are released in beta.

dpashkevich commented 11 years ago

The plugin doesn't seem to respect the "folder_exclude_patterns" defined in my .sublime-project file. When I try to run "Show TODOs: Project and open files", I can see that the pluging counts thousands of files and eventually hags ST2 (I have a big library with source files, generated documentation, node modules and other stuff in my project).

For the sake of experiment, I copy-pasted the same exclude patterns into my User preferences under the todo object and now the plugin actually excludes them.

Please look into this issue cause it makes the plugin really unusable, I obviously don't want to store project-specific settings in my User preferences.