You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When SwiftLint emits a warning or error, it would be great if it could include the line of code and a cursor like compilers do.
For example, with the following Swift compiler output:
Untitled.swift:1:4: error: binary operator '+' cannot be applied to operands of type 'Int' and 'String'
23 + "foo"
~~ ^ ~~~~~
the ~~ ^ ~~~~~ is the cursor, and it's preceded by the line of code in question.
The reason I want this output is primarily because xcpretty apparently requires it in order to actually display warnings/errors. Without this, xcpretty is completely swallowing up all SwiftLint output.
The text was updated successfully, but these errors were encountered:
This is a great idea! Especially useful too if you're using SwiftLint from the command line and fixing violations in an editor other than Xcode, which I do from time to time.
If you have some time, this would be a fantastic contribution.
A good place to start would be to take a look at a similar function we use in our tests to render violations inline with the content. It's quite simple, it's called render(violations:in:) and outputs violations in this format:
func abc()↓{
^ warning: Opening Brace Spacing Violation:Opening braces should be preceded by a single space and on the same line asthe declaration.(opening_brace)}
This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions!
New Issue Checklist
Enhancement Request
When SwiftLint emits a warning or error, it would be great if it could include the line of code and a cursor like compilers do.
For example, with the following Swift compiler output:
the
~~ ^ ~~~~~
is the cursor, and it's preceded by the line of code in question.The reason I want this output is primarily because
xcpretty
apparently requires it in order to actually display warnings/errors. Without this,xcpretty
is completely swallowing up all SwiftLint output.The text was updated successfully, but these errors were encountered: