From e3a84be9c6ab56a562b514816aab3a62cb1e0957 Mon Sep 17 00:00:00 2001 From: Hamza Hamidi <22576950+hamzahamidi@users.noreply.github.com> Date: Sun, 14 Jun 2020 04:03:25 +0200 Subject: [PATCH] refactor(operations): linter remove redundant colorama --- azdev/operations/linter/linter.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/azdev/operations/linter/linter.py b/azdev/operations/linter/linter.py index 6e95528c..34471f5d 100644 --- a/azdev/operations/linter/linter.py +++ b/azdev/operations/linter/linter.py @@ -12,7 +12,7 @@ from pkgutil import iter_modules from enum import Enum import yaml -import colorama +from colorama import deinit, Fore, init from knack.log import get_logger from azdev.utilities.path import get_cli_repo_path, get_ext_repo_paths @@ -241,7 +241,7 @@ def run(self, run_params=None, run_commands=None, run_command_groups=None, run_h found_rules.add(rule_name) add_to_linter_func(self) - colorama.init() + init() # run all rule-checks if run_help_files_entries and self._rules.get('help_file_entries'): self._run_rules('help_file_entries') @@ -271,11 +271,10 @@ def run(self, run_params=None, run_commands=None, run_command_groups=None, run_h exclusions.update(self._violiations) yaml.safe_dump(exclusions, open(exclusion_path, 'w')) - colorama.deinit() + deinit() return self.exit_code def _run_rules(self, rule_group): - from colorama import Fore for rule_name, (rule_func, linter_callable, rule_severity) in self._rules.get(rule_group).items(): severity_str = rule_severity.name # use new linter if needed