fastlane-community / xcov

Nice code coverage reporting without hassle
MIT License
556 stars 107 forks source link

Add file path to json output #178

Closed cconstable closed 4 years ago

cconstable commented 4 years ago

What

Adds the file path when generating json reports (via --json_report).

Old output

"files": [
  { 
    "name": "MyFile.swift",
    "coverage": 0,
    ...

New output

"files": [
  { 
    "name": "MyFile.swift",
    "path":"/Users/me/project/MyFile.swift",
    "coverage": 0,
    ...

Why

To assist automated tooling, it's helpful to know the path of the files. In larger projects, it's not uncommon to have duplicate file names across targets. Reconciling the coverage name with the actual file requires either a) parsing the Xcode coverage reports ourselves or b) keeping track of the corresponding target and parsing Xcode project files. Both options seem pretty unfortunate.

Open questions

cconstable commented 4 years ago

Hey @joshdholtz, hope you are staying safe! Do you have any thoughts on this? If you feel additional changes are needed I would be happy to make them.

joshdholtz commented 4 years ago

@cconstable Ah, sorry I missed this! I appreciate the ping 😊 This looks good! I'll merge and get a new version out 💪

joshdholtz commented 4 years ago

@cconstable 1.7.4 is release!