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

Redundant type annotation rule ignores nested types #3146

Closed
iby opened this issue Mar 22, 2020 · 1 comment · Fixed by #5389 or #5537
Closed

Redundant type annotation rule ignores nested types #3146

iby opened this issue Mar 22, 2020 · 1 comment · Fixed by #5389 or #5537
Labels
bug Unexpected and reproducible misbehavior.

Comments

@iby
Copy link

iby commented Mar 22, 2020

New Issue Checklist

Describe the bug

Redundant type annotation ignores nested types, for example, the following static property doesn't get picked up, while others are:

fileprivate static let version: AnnouncementStore.Attribute = AnnouncementStore.Attribute("Version")

Environment

  • SwiftLint version: 0.39.1
  • Installation method used: Homebrew
  • Paste your configuration file:
# https://realm.github.io/SwiftLint/rule-directory.html
# https://github.com/realm/SwiftLint#configuration
# swiftlint rules

included: source

disabled_rules:
  - cyclomatic_complexity
  - discarded_notification_center_observer
  - duplicate_imports
  - file_length
  - force_cast
  - force_try
  - function_body_length
  - function_parameter_count
  - identifier_name
  - large_tuple
  - line_length
  - nesting
  - opening_brace
  - private_over_fileprivate
  - redundant_discardable_let
  - type_body_length
  - type_name
  - unused_closure_parameter
  - unused_setter_value # https://github.com/realm/SwiftLint/issues/2585
  - weak_delegate

opt_in_rules:
  redundant_type_annotation

trailing_comma:
  mandatory_comma: true

trailing_whitespace:
  ignores_comments: false

vertical_whitespace:
  max_empty_lines: 2

switch_case_alignment:
  indented_cases: true
  • Are you using nested configurations: No
  • Which Xcode version are you using: Xcode 11.3, Build version 11C29
  • Do you have a sample that shows the issue: See above.
@marcelofabri marcelofabri added the bug Unexpected and reproducible misbehavior. label Aug 4, 2020
@stale
Copy link

stale bot commented Nov 8, 2020

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!

@stale stale bot added the wontfix Issues that became stale and were auto-closed by a bot. label Nov 8, 2020
@stale stale bot closed this as completed Nov 15, 2020
@jpsim jpsim reopened this Feb 23, 2021
@jpsim jpsim removed the wontfix Issues that became stale and were auto-closed by a bot. label Feb 23, 2021
marcelofabri added a commit that referenced this issue Oct 24, 2022
marcelofabri added a commit that referenced this issue Oct 24, 2022
SimplyDanny pushed a commit that referenced this issue Feb 9, 2024
@SimplyDanny SimplyDanny reopened this Apr 21, 2024
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
4 participants