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

Error when folder_exclude_patterns contains directory "cache", "logs" #34

Closed dkavelin closed 11 years ago

dkavelin commented 11 years ago

I have folders in project named "cache" and "logs" and i dont want TODO plugin to scan them. I edit config file and get errors in console

Exception in thread Thread-42: Traceback (most recent call last): File ".\threading.py", line 532, in __bootstrap_inner File ".\todo.py", line 289, in run File ".\todo.py", line 226, in format File ".\todo.py", line 169, in extract File ".\todo.py", line 155, in filter_files File ".\todo.py", line 143, in iter_files ValueError: list.remove(x): x not in list

Sublime 2.0.1, WIndows 7

robcowie commented 11 years ago

You've definitely discovered a bug. Could you post the relevant config? That would help me to be clear about the problem.

Could you also confirm that the plugin is up to date (v1.1.1)

dkavelin commented 11 years ago

OK, i understand what happed :) I've got folders "cache" and "logs" in section "folder_exclude_patterns" of main config file and this cause plugin failure.

robcowie commented 11 years ago

Can you post your config (just the todo section will do). Thanks

dkavelin commented 11 years ago

Sublime Text 2/Packages/User/Preferences.sublime-settings

{ "auto_complete_delay": 500, "bold_folder_labels": true, "color_scheme": "Packages/Color Scheme - Default/Monokai Bright.tmTheme", "create_window_at_startup": false, "file_exclude_patterns": [ "index.html", ".htaccess" ], "folder_exclude_patterns": [ ".svn", ".git", ".hg", "CVS", "logs", "errors", "cache" ], "font_size": 13.0, "highlight_line": true, "highlight_modified_tabs": true, "line_padding_top": 0, "rulers": [ 120 ], "show_full_path": true, "show_tab_close_buttons": true, "theme": "Default.sublime-theme", "todo": { "case_sensitive": true, "file_excludepatterns": [ ".html" ], "folder_exclude_patterns": [ "views", "config", "third_party", "system", "upload", "userquide", "language" ], "patterns": { "FIXME": "FIX ?ME[\s]?:+(?P\S.)$", "NOTE": "w4w23w2", // I dont use NOTE sections "TODO": "TODO[\s]?:+(?P.*)$" }, "result_title": "TODO Results" }, "tree_animation_enabled": false, "trim_trailing_white_space_on_save": false, "word_wrap": "false" }

robcowie commented 11 years ago

Ok, I'm guessing that at one point, you also had cache or logs in the todo-specific folder_exclude_patterns as well as the top-level folder_exclude_patterns. That certainly causes the error you saw.

I'll push a fix shortly and let you know.

robcowie commented 11 years ago

Let me know if the problem has disappeared