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

explicit_type_interface collides with redundant_type_annotation for Bool #3578

Open
2 tasks done
kubalani opened this issue Mar 22, 2021 · 0 comments
Open
2 tasks done
Labels
bug Unexpected and reproducible misbehavior.

Comments

@kubalani
Copy link

New Issue Checklist

Describe the bug

This bug exist in version 0.43 and is introduced by #3438

The above change re-introduced the bug #2312 for Bool as allow_redundancy is no longer honored.
The error doesn't repro in version older than 0.43

Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint

Redundant Type Annotation Violation: Variables should not have redundant type annotation (redundant_type_annotation)

Environment

SwiftLint installed via brew

whitelist_rules:
  - redundant_type_annotation

  - explicit_type_interface

explicit_type_interface: # requires type annotation on everything but local variables and constants
  excluded:
    - local
  allow_redundancy: true # Ignores rule if it would result in redundancy
swiftlint_version: 0.43.1

To test execute

if which swiftlint >/dev/null; then
    swiftlint --config --strict .swiftlint.yml
else
    echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi

Xcode version 12.4

Swift code that triggers the warning

    private var isFirstLaunch: Bool = true
@SimplyDanny SimplyDanny added the bug Unexpected and reproducible misbehavior. label Sep 11, 2022
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

2 participants