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

Swiftlint --fix adding weak to a non protocol value #3805

Closed
2 tasks done
ppamorim opened this issue Jan 12, 2022 · 1 comment
Closed
2 tasks done

Swiftlint --fix adding weak to a non protocol value #3805

ppamorim opened this issue Jan 12, 2022 · 1 comment

Comments

@ppamorim
Copy link

ppamorim commented Jan 12, 2022

New Issue Checklist

Similar to #3611 but #3599 won't fix.

Describe the bug

For the given variable:

private var fooDelegate: Bool = false

When running:

$ swiftlint --fix

Swiftlint is transforming var to weak var probably because it has delegate on the name, this is causing the compilation to fail.

Environment

  • SwiftLint version (run swiftlint version to be sure)? 0.45.1
  • Installation method used (Homebrew, CocoaPods, building from source, etc)? Homebrew
  • Paste your configuration file:
disabled_rules:
  - identifier_name
  - line_length
  - todo
  - cyclomatic_complexity
  - type_body_length
  - file_length
  - function_body_length
  - function_parameter_count
  - nesting
  - block_based_kvo
  
  - unused_closure_parameter
  - explicit_type_interface
  - large_tuple
  - inclusive_language

opt_in_rules: # some rules are only opt-in
  - explicit_type_interface
  - force_unwrapping
  - implicit_return
  - attributes
  - closure_end_indentation
  - closure_spacing
  - conditional_returns_on_newline
  - empty_string
  - contains_over_first_not_nil
  # - empty_count //Disabled due Realm conflict
  # - first_where //Disabled due Realm conflict

excluded:
  - Carthage
  - Pods

force_cast: warning
force_try: warning
  • Are you using nested configurations? No
  • Which Xcode version are you using (check xcodebuild -version)? Xcode 13.2.1
  • Do you have a sample that shows the issue? Described above.
@jpsim
Copy link
Collaborator

jpsim commented Jan 21, 2022

I'm removing the rule here: #3809

It's extremely prone to false positives.

@jpsim jpsim closed this as completed Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants