Changes between Version 17 and Version 18 of CodeTagsPlugin
- Timestamp:
- Dec 3, 2008, 12:23:12 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CodeTagsPlugin
v17 v18 1 1 = A plugin for displaying code tags (`XXX`, `FIXME`, `TODO`, etc.) = 2 '''NOTE''': {{{The links below seem to be dead. A }}}[http://git.mortis.eu/codetags.git git repository]{{{ is available instead.}}}3 2 4 Blog posting [http://trac.pocoo.org/wiki/blog/2006/06/06/00.04 here], Demo [http:// trac.pocoo.org/codetags here], [http://trac.pocoo.org/repos/sandbox/codetags-plugin/ SVNrepository].3 Blog posting [http://trac.pocoo.org/wiki/blog/2006/06/06/00.04 here], Demo [http://developer.wz2100.net/codetags here], [http://git.mortis.eu/codetags.git git repository]. 5 4 Since I cannot find any documentation directly I just wanted to tell you people that you need a subdirectory named cache thats writeable by your trac to make this work. Oh and dont wonder that it takes so much time the first time used ;). Also don't forget to grant the CODETAGS_VIEW permission. 6 5 … … 20 19 {{{scan_files}}} allows you to define specific file types to scan (default: *) [[br]] 21 20 {{{scan_folders}}} specifies which directories within the repository to scan (default: *) [[br]] 21 {{{exclude_folders}}} specifies directories that are subdirectories of {{{scan_folders}}} but don't need to be scanned [[br]] 22 22 {{{tags}}} allows you to specify what tags to locate, though only the defaults are colored at all. (default: XXX, TODO, FIXME) [[br]] 23 23 … … 26 26 User submitted patch seems to work: http://trac.pocoo.org/attachment/ticket/109/diff.txt 27 27 28 Given the configuration options, I feel that the above referenced patch is unneeded if you have configured properly. On the other hand, there are legitimate uses for long strings of XXX's without them being a code tag. A simple one line change in indexer.py would eliminate 99% of XXX tags that were unintentional by requiring them to end with a colon: 29 30 {{{ 31 #!diff 32 Index: indexer.py 33 =================================================================== 34 --- indexer.py (revision 2368) 35 +++ indexer.py (working copy) 36 @@ -27,7 +27,7 @@ 37 38 p = [] 39 for word in self.tags: 40 - p.append(re.escape(word)) 41 + p.append(re.escape(word + ':')) 42 self.tag_re = re.compile(r'(%s)\:?\s*(.*?)\s*$' % '|'.join(p)) 43 44 cdir = os.path.join(os.path.abspath(env.path), 'cache', 'codetags') 45 }}} 46 47 I Think This Approach is better the Regex Matches TAG: AND TAG[SPACE]. 48 The Above Patch only Matches TAG:Word & TAG::Word and TAG:[SPACE] 49 {{{ 50 #!diff 51 Index: indexer.py 52 =================================================================== 53 --- indexer.py (revision HEAD) 54 +++ indexer.py (working copy) 55 @@ -28,5 +28,5 @@ 56 57 for word in self.tags: 58 p.append(re.escape(word)) 59 - self.tag_re = re.compile(r'(%s)\:?\s*(.*?)\s*$' % '|'.join(p)) 60 + self.tag_re = re.compile(r'(%s)[\:\s]+(.*?)\s*$' % '|'.join(p)) 61 62 cdir = os.path.join(os.path.abspath(env.path), 'cache', 'codetags') 63 }}} 64 65 = Word Boundaries Patch = 66 If you don't want to match comment lines containing your tags as subwords (e.g. DEBUG contains BUG and would normally match), you can apply this patch to {{{indexer.py}}}: 67 68 {{{ 69 #!diff 70 30c30 71 < p.append(re.escape(word)) 72 --- 73 > p.append(r'\b' + re.escape(word) + r'\b') 74 }}} 28 This patch is now most likely unnecessary though, because CodeTagsPlugin plugin now searches for word boundaries (regex '\b') at the edges of words. 75 29 76 30 = Feature Request = … … 80 34 * Choose display for only specified tags 81 35 * Chose display for only specified path in repository 82 * Additionally allow for blacklisting and/or patterns. E.g. we have plenty of BUG_FOOBAR constants that we obviously dont want in the list, so a blacklist for BUG_ but then still using all other BUG things would be nice.