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

[New Output] Support Note Output #311

Merged
merged 6 commits into from
Feb 10, 2025

Conversation

ikelax
Copy link
Contributor

@ikelax ikelax commented Aug 21, 2024

Adresses #208.

Changes

Add a capture group for the Note output.

Testing

  • Added new unit tests

@ikelax ikelax requested a review from cpisciotta as a code owner August 21, 2024 11:10
Copy link

codecov bot commented Aug 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.20%. Comparing base (de4629e) to head (4b70b45).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #311      +/-   ##
==========================================
+ Coverage   90.16%   90.20%   +0.04%     
==========================================
  Files          17       17              
  Lines        2470     2481      +11     
==========================================
+ Hits         2227     2238      +11     
  Misses        243      243              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ikelax
Copy link
Contributor Author

ikelax commented Aug 21, 2024

@cpisciotta Currently, the tests do not check if the strings are coloured correctly if I am not mistaken. Do you think this should be covered? What do you think about the formatting I chose for this output?

…erers. Additionally, I had to decrease the magic numbers in ParsingTests.swift.
@ikelax ikelax force-pushed the issue-208-support-note-output branch from 62a9ad6 to 37cb126 Compare August 21, 2024 11:26
Copy link
Owner

@cpisciotta cpisciotta left a comment

Choose a reason for hiding this comment

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

Hey @ikelax! I appreciate your contribution. Happy to get this merged in, but can you fix the conflicts first? Thanks!

/// Regular expression captured groups:
/// $1 = note
/// $2 = information
static let regex = Regex(pattern: "^(note:) (.*)")
Copy link
Owner

Choose a reason for hiding this comment

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

nit: We can change this to `"^note: (.*)$".

No need to capture note, since it's a static keyword.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will fix it.

@cpisciotta
Copy link
Owner

@cpisciotta Currently, the tests do not check if the strings are coloured correctly if I am not mistaken. Do you think this should be covered? What do you think about the formatting I chose for this output?

I think it LGTM! No need to test the colored output.

In the last commit, I removed the capturing of "note: " because it is a
static keyword and forgot to adapt the comment. Only the actual note is
captured.
Two of the magic numbers in ParsingTests had decreased because more
lines are captured by the parser. So, I had to adjust it.
@ikelax
Copy link
Contributor Author

ikelax commented Jan 29, 2025

@cpisciotta Thank you for review! Sorry, for the delay. I fixed the merge conflicts, added a test for the Azure DevOps pipeline renderer and made the change suggested by you.

Comment on lines +350 to +364
func testNotMatchNote() throws {
let inputs = [
"in the note middle",
"in the note: middle",
"note Building targets in dependency order",
"Note Metadata extraction skipped.",
"Target dependency graph (12 targets) note",
"Target dependency graph (12 targets) note:",
"Target dependency graph (12 targets): note:",
]

for input in inputs {
XCTAssertNil(parser.parse(line: input))
}
}
Copy link
Owner

Choose a reason for hiding this comment

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

Nice. Thanks for adding this test.

@cpisciotta cpisciotta merged commit 9a55533 into cpisciotta:main Feb 10, 2025
15 checks passed
@cpisciotta
Copy link
Owner

Thanks for your contribution @ikelax!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants