Skip to content

Commit

Permalink
make verbosity disabled by default (#47)
Browse files Browse the repository at this point in the history
Users can still enable verbosity by re-running a CI job with debugging logs enabled.

Not outputting debug logs in production will save users billable CI runtime.
  • Loading branch information
2bndy5 committed Jan 1, 2024
1 parent e640af3 commit d1d07c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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

0 comments on commit d1d07c7

Please sign in to comment.