xcbeautify icon indicating copy to clipboard operation
xcbeautify copied to clipboard

Regex of CompileWarning will be mismatched some other warnings.

Open blastmann opened this issue 1 year ago • 1 comments

Here is an example log:

/Volumes/data/workspace/ABCFile.m:110:27: warning: unused variable 'domainWhitelist' [-Wunused-variable]
ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found
ld: Undefined symbols:
  _xxxx, referenced from:
      -[ABC testcase] in tests.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Because of the parser will move to top for next fast check, the line of ld warning will be mismatched and outputs of Undefined symbols will be disappeared like this:

image

I think the regex of CompileWarning should exclude LDWarning properly like this:

static let regex = Regex(pattern: #"^(?!ld)(([^:]*):*\d*:*\d*):\swarning:\s(.*)$"#)

blastmann avatar Feb 26 '24 12:02 blastmann

Hey @blastmann! Thanks for filling this. It looks like this relates to xcbeautify's one-line-at-a-time logic. I plan to refactor this after I release 2.0.0 (expected to release this week). It'll likely be a couple of weeks before I can introduce the logic that I think will be necessary to then fix this issue. In the meantime, you might find it helpful to pass the --preserve-unbeautified flag. Rest assured, this is on my radar.

cpisciotta avatar Feb 26 '24 14:02 cpisciotta