[gnome-builder] todo: detect keywords even without colon
- From: Alexandre Franke <afranke src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] todo: detect keywords even without colon
- Date: Fri, 12 May 2017 14:43:59 +0000 (UTC)
commit 4491e30e5033c82bdefae29054ff46a563fb7c25
Author: Alexandre Franke <alexandre franke gmail com>
Date: Fri May 12 16:14:16 2017 +0200
todo: detect keywords even without colon
plugins/todo/todo_plugin/__init__.py | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/plugins/todo/todo_plugin/__init__.py b/plugins/todo/todo_plugin/__init__.py
index 4f69e59..ff60438 100644
--- a/plugins/todo/todo_plugin/__init__.py
+++ b/plugins/todo/todo_plugin/__init__.py
@@ -1,5 +1,4 @@
#!/usr/bin/env python3
-
#
# todo.py
#
@@ -38,7 +37,7 @@ _ = Ide.gettext
LINE1 = re.compile('(.*):(\d+):(.*)')
LINE2 = re.compile('(.*)-(\d+)-(.*)')
-KEYWORDS = ['FIXME:', 'XXX:', 'TODO:']
+KEYWORDS = ['FIXME', 'XXX', 'TODO']
class TodoWorkbenchAddin(GObject.Object, Ide.WorkbenchAddin):
workbench = None
@@ -119,12 +118,12 @@ class TodoWorkbenchAddin(GObject.Object, Ide.WorkbenchAddin):
trying to write anything too complex that would just approximate
the same thing anyway.
"""
- args = ['grep', '-A', '5', '-I', '-H', '-n', '-r']
+ args = ['grep', '-A', '5', '-I', '-H', '-n', '-r', '-E']
for ignore_dir in ['.flatpak-builder', '.git']:
args.append('--exclude-dir={}'.format(ignore_dir))
for keyword in KEYWORDS:
args.append('-e')
- args.append(keyword)
+ args.append("{0}(:| )".format(keyword))
args.append(file.get_path())
p = subprocess.Popen(args, stdout=subprocess.PIPE)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]