Skip to content

Commit

Permalink
Fix running all sniffs in contrib when atleast one is imported
Browse files Browse the repository at this point in the history
  • Loading branch information
justjkk committed Feb 26, 2015
1 parent 92e15ee commit 27555eb
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions fabpolish/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@

from functools import wraps

from fabric.main import list_commands
from fabric.api import lcd, local, settings, task, puts, hide
from fabric.colors import green

import fabfile

FABFILE_DIR = os.path.abspath(os.path.dirname(fabfile.__file__))

__version__ = '1.0.0'
__version__ = '1.0.1'


def info(text):
Expand Down Expand Up @@ -77,13 +78,20 @@ def polish(env='dev'):
When environment is 'dev', only fast-critical and fast-major
sniffs are run.
"""
fabric_tasks = list_commands('', 'short')
results = list()
with settings(warn_only=True):
if env == 'ci':
sniffs_to_run = _sniffs
sniffs_to_run = []
for sniff in _sniffs:
if sniff['function'].name not in fabric_tasks:
continue
sniffs_to_run.append(sniff)
elif env == 'dev':
sniffs_to_run = []
for sniff in _sniffs:
if sniff['function'].name not in fabric_tasks:
continue
if sniff['timing'] != 'fast':
continue
if sniff['severity'] not in ('critical', 'major'):
Expand Down

0 comments on commit 27555eb

Please sign in to comment.