@expo/xcpretty
Advanced tools
Comparing version 3.1.2 to 3.1.3
@@ -561,2 +561,10 @@ "use strict"; | ||
const icon = color(isError ? symbols_1.ERROR : symbols_1.WARNING); | ||
const relativeFilePath = filePath ? slash(path.relative(projectRoot, filePath)) : null; | ||
const formattedPath = formatPaths({ | ||
filePath: relativeFilePath, | ||
col: column, | ||
line, | ||
}); | ||
const pathWithPrefix = `${icon} ${formattedPath}`; | ||
const formattedReason = color(grayOutMatch(reason, /(\[-.*?\])/).replace(/(\(.*?\)\s?)/, '')); | ||
try { | ||
@@ -570,17 +578,16 @@ const raw = fs.readFileSync(filePath, 'utf8'); | ||
// Remove `(_Nonnull, _Nullable, or _Null_unspecified)` options | ||
message: color(grayOutMatch(reason, /(\[-.*?\])/).replace(/(\(.*?\)\s?)/, '')), | ||
message: formattedReason, | ||
}); | ||
const relativeFilePath = filePath ? slash(path.relative(projectRoot, filePath)) : null; | ||
const formattedPath = formatPaths({ | ||
filePath: relativeFilePath, | ||
col: column, | ||
line, | ||
}); | ||
return `\n${icon} ${formattedPath}\n\n${framed}\n`; | ||
return `\n${pathWithPrefix}\n\n${framed}\n`; | ||
} | ||
catch { | ||
// TODO: Format legacy like JS | ||
return `\n${icon} ${filePath}: ${color(reason)}\n\n${lineText}\n${chalk_1.default.cyan(cursor)}\n`; | ||
// If the column property could be found, then use that to fix the cursor location which is often broken in regex. | ||
const customCursor = column == null ? chalk_1.default.reset(cursor) : fill(column) + chalk_1.default.reset('^'); | ||
const framed = `${lineText}\n${customCursor} ${formattedReason}`; | ||
return `\n${pathWithPrefix}\n\n${framed}\n`; | ||
} | ||
} | ||
function fill(width) { | ||
return Array(width).join(' '); | ||
} | ||
// Dim values like `[-Wnullability-completeness]` | ||
@@ -587,0 +594,0 @@ function grayOutMatch(text, reg) { |
{ | ||
"name": "@expo/xcpretty", | ||
"description": "Parse and format xcodebuild logs", | ||
"version": "3.1.2", | ||
"version": "3.1.3", | ||
"main": "build/index.js", | ||
@@ -42,2 +42,2 @@ "types": "build/index.d.ts", | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
218269
2568