Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(operations): linter remove redundant colorama #212

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions azdev/operations/linter/linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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')
Expand Down Expand Up @@ -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
Expand Down