Add lint --non-fixable-only flag#1214
Open
ValentinWalter wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
lint --non-fixable-onlyoption.This filters lint output to findings that cannot be fixed by swift-format format, so callers can avoid surfacing warnings for issues the formatter can already handle. Useful for only displaying non fixable issues in an IDE, while leaving fixable ones for automations. Especially warnings about whitespace can get very noisy in IDEs.
Finding.isFixable.Rule.diagnoseAPI and adds an overload for explicit fixability.Current mixed cases are:
NoAssignmentInExpressions: Onlyreturn x = yis auto-rewritten. Other assignment expressions, likewhile x = y, are diagnosed but not safely movable.OneVariableDeclarationPerLine: Multi-binding declarations are fixable only when splitting preserves valid Swift. Invalid forms likevar a, b = 1are diagnosed but preserved.OrderedImports: Duplicate imports are removable unless both copies have trailing trivia/comments. In that case the duplicate is diagnosed but not merged.ReturnVoidInsteadOfEmptyTuple:() -> ()is rewritten to() -> Void, unless the empty tuple contains interior trivia/comments like(/* comment */).