Skip to content

Commit

Permalink
coala: Add show_bears to main script
Browse files Browse the repository at this point in the history
The coala main script handles the --show_bears argument.

Fixes #477
  • Loading branch information
Udayan12167 committed May 28, 2015
1 parent 603e53a commit bc23504
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions coalib/coala.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from coalib.misc.StringConstants import StringConstants
from coalib.processes.SectionExecutor import SectionExecutor
from coalib.settings.SectionManager import SectionManager
from coalib.output.show_bears import show_bears

from coalib.misc.i18n import _

Expand All @@ -31,18 +32,27 @@ def main():
yielded_results = False
sections, local_bears, global_bears, targets, interactor, log_printer \
= SectionManager().run()
for section_name in sections:
section = sections[section_name]
if not section.is_enabled(targets):
continue
if "show_bears" in sections["default"]:
if sections["default"]["show_bears"]:
show_bears(sections,
local_bears,
global_bears,
targets,
interactor)
did_nothing = False
else:
for section_name in sections:
section = sections[section_name]
if not section.is_enabled(targets):
continue

yielded_results = yielded_results or SectionExecutor(
section=section,
global_bear_list=global_bears[section_name],
local_bear_list=local_bears[section_name],
interactor=interactor,
log_printer=log_printer).run()[0]
did_nothing = False
yielded_results = yielded_results or SectionExecutor(
section=section,
global_bear_list=global_bears[section_name],
local_bear_list=local_bears[section_name],
interactor=interactor,
log_printer=log_printer).run()[0]
did_nothing = False

if did_nothing:
interactor.did_nothing()
Expand Down

0 comments on commit bc23504

Please sign in to comment.