Skip to content

Commit

Permalink
[Linter] Fix minor display issue in azdev linter (#259)
Browse files Browse the repository at this point in the history
* fix display issue

* bump version and add history

* refract

* format output
  • Loading branch information
mmyyrroonn authored Aug 25, 2020
1 parent d054b76 commit 75a1a79
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
Release History
===============
0.1.28
++++++
* [Linter] Fix minor display issue in `azdev linter`.

0.1.27
++++++
* [Linter] "Show" command should use `show_command` or `custom_show_command`.
Expand Down
2 changes: 1 addition & 1 deletion azdev/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# license information.
# -----------------------------------------------------------------------------

__VERSION__ = '0.1.27'
__VERSION__ = '0.1.28'
8 changes: 4 additions & 4 deletions azdev/operations/linter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,7 @@ def run_linter(modules=None, rule_types=None, rules=None, ci_exclusions=None,
run_commands=not rule_types or 'commands' in rule_types,
run_command_groups=not rule_types or 'command_groups' in rule_types,
run_help_files_entries=not rule_types or 'help_entries' in rule_types)
logger.info(os.linesep)
logger.info('Run custom pylint rules.')
display(os.linesep + 'Run custom pylint rules.')
exit_code += pylint_rules(selected_modules)
sys.exit(exit_code)

Expand All @@ -178,9 +177,10 @@ def pylint_rules(selected_modules):
pylint_result = run_pylint(selected_modules, env=my_env, checkers=checkers, disable_all=True, enable=enable)
if pylint_result and not pylint_result.error:
display(os.linesep + 'No violations found for custom pylint rules.')
display('Linter: PASSED\n')
if pylint_result and pylint_result.error:
logger.info(pylint_result.error.output.decode('utf-8'))
logger.info('Linter: FAILED\n')
display(pylint_result.error.output.decode('utf-8'))
display('Linter: FAILED\n')
return pylint_result.exit_code


Expand Down

0 comments on commit 75a1a79

Please sign in to comment.