Skip to content

Conversation

@redsun82
Copy link
Contributor

Also added a new logging_color option to disable coloring (which does not look very good in files).

Also added a new `logging_color` option to disable coloring (which does
not look very good in files).
Copilot AI review requested due to automatic review settings February 27, 2025 11:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR addresses issues in the qltest logging by updating the extractor’s logging options and adding a new logging_color option so that colored output can be disabled when writing to files. Key changes include:

  • Adding a new color option to the CodeQL extractor configuration file.
  • Updating Cargo.toml to add the is-terminal dependency.
  • Adjusting logging setup in main.rs and introducing a new Color enum (with corresponding functionality) in config.rs and shared/tree-sitter-extractor.

Reviewed Changes

File Description
rust/codeql-extractor.yml Added a new color option with a pattern restricting values to "yes" or "no".
rust/extractor/Cargo.toml Added a dependency on is-terminal.
rust/extractor/src/main.rs Updated logging subscriber initialization to use the logging_color option.
rust/extractor/src/config.rs Introduced a new Color enum with a yes() helper method and integrated it into Config.
shared/tree-sitter-extractor/src/extractor/mod.rs Added a Color enum with a from(bool) method and updated the default_subscriber_with_level accordingly.

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

rust/extractor/src/config.rs:37

  • [nitpick] Consider implementing a From for Color to align its API with the Color enum defined in shared/tree-sitter-extractor, which may simplify conversions and improve consistency across modules.
pub enum Color {

Tip: If you use Visual Studio Code, you can request a review from Copilot before you push from the "Source Control" tab. Learn more

@github-actions github-actions bot added the Rust Pull requests that update Rust code label Feb 27, 2025
@redsun82 redsun82 requested a review from a team as a code owner February 27, 2025 16:08
@redsun82 redsun82 closed this Mar 4, 2025
@redsun82 redsun82 deleted the redsun82/rust-ql-test-log-fix branch March 4, 2025 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants