cpisciotta / xcbeautify

A little beautifier tool for xcodebuild
MIT License
957 stars 68 forks source link

Regex of CompileWarning will be mismatched some other warnings. #255

Open blastmann opened 7 months ago

blastmann commented 7 months ago

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(.*)$"#)
cpisciotta commented 7 months ago

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.