Skip to content

Commit

Permalink
Make comment annotation configurable
Browse files Browse the repository at this point in the history
This patch adds a general config option `annotation_comments` that
defaults to True (current behavior) and lets users turn off annotations
for issue comments. This is super handy if you're on large github
issue threads.
  • Loading branch information
ryansb committed Sep 4, 2015
1 parent c48348f commit 1667619
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bugwarrior/services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ def __init__(self, config, main_section, target):
config.get(self.main_section, 'annotation_links')
)

self.annotation_comments = True
if config.has_option(self.main_section, 'annotation_comments'):
self.annotation_comments = asbool(
config.get(self.main_section, 'annotation_comments')
)

self.shorten = False
if config.has_option(self.main_section, 'shorten'):
self.shorten = asbool(config.get(self.main_section, 'shorten'))
Expand Down Expand Up @@ -165,6 +171,8 @@ def build_annotations(self, annotations, url):
final = []
if self.annotation_links:
final.append(url)
if not self.annotation_comments:
return final
for author, message in annotations:
message = message.strip()
if not message or not author:
Expand Down

0 comments on commit 1667619

Please sign in to comment.