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

make verbosity disabled by default #47

Merged
merged 1 commit into from Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion cpp_linter/cli.py
@@ -1,6 +1,7 @@
"""Setup the options for CLI arguments."""
import argparse
import logging
from os import environ

cli_arg_parser = argparse.ArgumentParser(
description="Run clang-tidy and clang-format on a list of changed files "
Expand All @@ -11,7 +12,7 @@
"-v",
"--verbosity",
type=int,
default=10,
default=20 - (10 if environ.get("ACTIONS_STEP_DEBUG", "") == "true" else 0),
help="""This controls the action's verbosity in the workflow's logs.
Supported options are defined by the `logging-level <logging-levels>`_.
This option does not affect the verbosity of resulting
Expand Down
3 changes: 2 additions & 1 deletion tests/test_cli_args.py
@@ -1,4 +1,5 @@
"""Tests related parsing input from CLI arguments."""
from os import environ
from typing import List, Union
import pytest
from cpp_linter.run import cli_arg_parser
Expand All @@ -8,7 +9,7 @@ class Args:
"""A pseudo namespace declaration. Each attribute is initialized with the
corresponding CLI arg's default value."""

verbosity: int = 10
verbosity: int = 20 - (10 if environ.get("ACTIONS_STEP_DEBUG", "") == "true" else 0)
database: str = ""
style: str = "llvm"
tidy_checks: str = (
Expand Down