-
Notifications
You must be signed in to change notification settings - Fork 34
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
feat: display up to 60 chars of the filepath in tree view #451
feat: display up to 60 chars of the filepath in tree view #451
Conversation
{ | ||
"ok": false, | ||
"error": "Missing node_modules folder: we can't test without dependencies.\nPlease run 'npm install' first.", | ||
"path": "/Users/user/Desktop/example-npm-project" | ||
} | ||
""".trimIndent()) | ||
""".trimIndent() |
Check warning
Code scanning / detekt
Reports mis-indented code Warning test
Missing node_modules folder: we can't test without dependencies. Please run 'npm install' first. | ||
""".trimIndent()) | ||
""".trimIndent() |
Check warning
Code scanning / detekt
Reports mis-indented code Warning test
{ | ||
"ok": false, | ||
"error": ["could not be","array here"], | ||
"path": "some/path/here" | ||
} | ||
""".trimIndent()) | ||
""".trimIndent() |
Check warning
Code scanning / detekt
Reports mis-indented code Warning test
{ | ||
"ok": false, | ||
"error": "error", | ||
"path_not_provided": "" | ||
} | ||
""".trimIndent()) | ||
""".trimIndent() |
Check warning
Code scanning / detekt
Reports mis-indented code Warning test
cliResult3.getFirstError()!!.message.contains( | ||
"Parameter specified as non-null is null: method snyk.oss.OssVulnerabilitiesForFile.copy, parameter displayTargetFile" |
Check warning
Code scanning / detekt
Reports lines with exceeded length Warning test
)) | ||
assertTrue( | ||
cliResult3.getFirstError()!!.message.contains( | ||
"Parameter specified as non-null is null: method snyk.oss.OssVulnerabilitiesForFile.copy, parameter displayTargetFile" |
Check warning
Code scanning / detekt
Line detected, which is longer than the defined maximum line length in the code style. Warning test
val relativePath = fileVulns.virtualFile?.let { | ||
GotoFileCellRenderer.getRelativePath( | ||
fileVulns.virtualFile, value.project | ||
) | ||
} ?: "" | ||
toolTipText = | ||
relativePath + fileVulns.sanitizedTargetFile + ProductType.OSS.getCountText(value.childCount) | ||
|
||
text = toolTipText.letIf(toolTipText.length > MAX_FILE_TREE_NODE_LENGTH) { | ||
"..." + it.substring( | ||
it.length - MAX_FILE_TREE_NODE_LENGTH, it.length | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be interesting for review
toolTipText = | ||
GotoFileCellRenderer.getRelativePath(file.virtualFile, file.project) + productType.getCountText( | ||
value.childCount | ||
) | ||
|
||
text = toolTipText.letIf(toolTipText.length > MAX_FILE_TREE_NODE_LENGTH) { | ||
"..." + it.substring( | ||
it.length - MAX_FILE_TREE_NODE_LENGTH, it.length | ||
) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be interesting for review
val relativePath = iacVulnerabilitiesForFile.virtualFile?.let { | ||
GotoFileCellRenderer.getRelativePath( | ||
iacVulnerabilitiesForFile.virtualFile, value.project | ||
) | ||
} ?: iacVulnerabilitiesForFile.targetFilePath | ||
toolTipText = relativePath + ProductType.IAC.getCountText(value.childCount) | ||
|
||
text = toolTipText.letIf(toolTipText.length > MAX_FILE_TREE_NODE_LENGTH) { | ||
"..." + it.substring( | ||
it.length - MAX_FILE_TREE_NODE_LENGTH, it.length | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be interesting for review
|
||
val virtualFile: VirtualFile? = LocalFileSystem.getInstance().findFileByPath(this.targetFilePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be interesting for review
val virtualFile: VirtualFile? = LocalFileSystem.getInstance().findFileByPath(this.path) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be interesting for review
mockkStatic(GotoFileCellRenderer::class) | ||
every { GotoFileCellRenderer.getRelativePath(any(), any()) } returns "abc/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be interesting for review
mockkStatic(GotoFileCellRenderer::class) | ||
every { GotoFileCellRenderer.getRelativePath(any(), any()) } returns "abc/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be interesting for review
668bd05
to
60972c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
Description
Display up to 60 chars of the filepath in tree view
Checklist
Screenshots / GIFs