From 780f3e403d4f259721fd77117af30b496047595a Mon Sep 17 00:00:00 2001 From: Roman Nikitin Date: Tue, 29 Jun 2021 15:11:41 +0300 Subject: [PATCH] Makefile fix, cli writing to stderr (fixing tests) --- Makefile | 2 +- cli/kube/destroy.py | 4 ++-- cli/utils.py | 8 +++++--- front/.eslintrc.js | 24 ++++++++++++------------ 4 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 9654b166..4c4224bb 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ lint-backend: flake8 --config .flake8 -.PHONY: lint-frontend: +.PHONY: lint-frontend lint-frontend: cd front && npx eslint . diff --git a/cli/kube/destroy.py b/cli/kube/destroy.py index b062da9b..cb6251f6 100644 --- a/cli/kube/destroy.py +++ b/cli/kube/destroy.py @@ -25,7 +25,7 @@ def destroy(): for entry in to_unset: utils.run_command(['kubectl', 'config', 'unset', entry]) - click.echo('Cleaning up the registry') + click.echo('Cleaning up the registry', err=True) cmd = [ 'yc', 'container', 'image', 'list', '--registry-id', registry_id, @@ -35,7 +35,7 @@ def destroy(): for image in registry_images: image_id = image['id'] image_name = image['name'] - click.echo(f'Removing image {image_name}') + click.echo(f'Removing image {image_name}', err=True) utils.run_command(['yc', 'container', 'image', 'delete', image_id]) utils.run_command( diff --git a/cli/utils.py b/cli/utils.py index f48856ea..eaba6494 100644 --- a/cli/utils.py +++ b/cli/utils.py @@ -121,6 +121,7 @@ def setup_auxiliary_structure(config: models.BasicConfig) -> models.Config: def run_command(command: List[str], cwd=None, env=None): + print_bold(f'Running command {command}') p = subprocess.Popen(command, cwd=cwd, env=env) rc = p.wait() if rc != 0: @@ -129,6 +130,7 @@ def run_command(command: List[str], cwd=None, env=None): def get_output(command: List[str], cwd=None, env=None) -> str: + print_bold(f'Running command {command}') return subprocess.check_output(command, cwd=cwd, env=env).decode() @@ -166,15 +168,15 @@ def print_file_exception_info(_func, path, _exc_info): def print_error(message: str): - click.secho(message, fg='red') + click.secho(message, fg='red', err=True) def print_success(message: str): - click.secho(message, fg='green') + click.secho(message, fg='green', err=True) def print_bold(message: str): - click.secho(message, bold=True) + click.secho(message, bold=True, err=True) def remove_file(path: Path): diff --git a/front/.eslintrc.js b/front/.eslintrc.js index 3f3df4f7..93ed0fea 100644 --- a/front/.eslintrc.js +++ b/front/.eslintrc.js @@ -1,14 +1,14 @@ module.exports = { - root: true, - env: { - node: true - }, - extends: ["plugin:vue/essential", "@vue/prettier"], - rules: { - "no-console": process.env.NODE_ENV === "production" ? "error" : "off", - "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off" - }, - parserOptions: { - parser: "babel-eslint" - } + root: true, + env: { + node: true, + }, + extends: ['plugin:vue/essential', '@vue/prettier'], + rules: { + 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', + }, + parserOptions: { + parser: 'babel-eslint', + }, };