Skip to content
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

Rule control_statement reports methods with keyword names #1946

Closed
2 tasks done
frenetisch-applaudierend opened this issue Nov 13, 2017 · 1 comment
Closed
2 tasks done
Labels
bug Unexpected and reproducible misbehavior.

Comments

@frenetisch-applaudierend
Copy link
Contributor

New Issue Checklist

Bug Report

Swiftlint version: 0.24.0
Installation method: Homebrew

The control_statement rule reports methods that have names equal to the control statement keywords. This is an issue if you e.g. use PromiseKit that uses catch in one of their method names.

The following triggers the rule and should not in my opinion:

func test() {
    foo().catch(all: true) {}
}
$ echo "foo().catch(all: true) {}" | swiftlint lint --no-cache --use-stdin --enable-all-rules
Loading configuration from '.swiftlint.yml'
<nopath>:1:7: warning: Control Statement Violation: if,for,while,do,catch statements shouldn't wrap their conditionals or arguments in parentheses. (control_statement)
Done linting! Found 1 violation, 0 serious in 1 file.
@Lutzifer
Copy link
Contributor

Second that

@marcelofabri marcelofabri added the bug Unexpected and reproducible misbehavior. label Nov 28, 2017
dirtydanee pushed a commit to dirtydanee/SwiftLint that referenced this issue Dec 18, 2017
dirtydanee pushed a commit to dirtydanee/SwiftLint that referenced this issue Dec 18, 2017
…mes are used

Fixes realm#1946 (+1 squashed commit)
Squashed commits:
[4cdcc48] Updates changelog entry
dirtydanee pushed a commit to dirtydanee/SwiftLint that referenced this issue Dec 18, 2017
Implements realm#1931. (+1 squashed commit)
Squashed commits:
[5911dcc] Fix false positives in control_statement when methods with keyword names are used

Fixes realm#1946 (+1 squashed commit)
Squashed commits:
[4cdcc48] Updates changelog entry
dirtydanee pushed a commit to dirtydanee/SwiftLint that referenced this issue Dec 18, 2017
…mes are used

Fixes realm#1946 (+1 squashed commit)
Squashed commits:
[4cdcc48] Updates changelog entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected and reproducible misbehavior.
Projects
None yet
Development

No branches or pull requests

3 participants