Skip to content

Allow colored logging output via CPP_LINTER_COLOR env var #275

@2bndy5

Description

@2bndy5

Is your idea related to an existing feature?

verbosity

Describe the behavior you would like

The logs can be rather monotonous when looking for errors.

The cpp-linter python package already has support for using the rich package to add color and style to log outputs. This action only needs to ensure rich is installed if users want colored (and stylized) output in the CI logs.

Proposal

- uses: cpp-linter/cpp-linter-action@v2
  env:
    # enabled colored output in logs (uses `rich` package)
    CPP_LINTER_COLOR: true

Acceptable values that mean "color enabled" include true, on, and 1. By default, color output should be disabled because the ASCII color codes are included in the raw logs that can be downloaded to a text file.

Describe alternatives you have considered

No response

Additional context

The cpp-linter-rs project already includes support for this env variable (see cpp-linter/cpp-linter-rs#52), and it does not require additional dependencies installed. Migrating this new feature to use the rust project should be seamless.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions