[gnome-builder/gnome-builder-3-24] todo: Ignore .flatpak-builder/ and .git/



commit 900cd6e75714c71593a955d658252563972baa72
Author: Matthew Leeds <mleeds redhat com>
Date:   Wed Mar 29 08:33:12 2017 -0500

    todo: Ignore .flatpak-builder/ and .git/
    
    Don't grep inside .flatpak-builder/ or .git/ when looking for TODO
    comments as it's a waste of resources and not what the user wants. If
    the user puts .flatpak-builder in their .gitignore the results will be
    ignored anyway but at least this way we don't waste the effort.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780678

 plugins/todo/todo_plugin/__init__.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/plugins/todo/todo_plugin/__init__.py b/plugins/todo/todo_plugin/__init__.py
index 2afd70c..712800f 100644
--- a/plugins/todo/todo_plugin/__init__.py
+++ b/plugins/todo/todo_plugin/__init__.py
@@ -119,6 +119,8 @@ class TodoWorkbenchAddin(GObject.Object, Ide.WorkbenchAddin):
         the same thing anyway.
         """
         args = ['grep', '-A', '5', '-I', '-H', '-n', '-r']
+        for ignore_dir in ['.flatpak-builder', '.git']:
+            args.append('--exclude-dir={}'.format(ignore_dir))
         for keyword in KEYWORDS:
             args.append('-e')
             args.append(keyword)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]