Skip to content

Allow additional types for valid_ibinspectable - #6963

Open
GtechGovind wants to merge 1 commit into
realm:mainfrom
GtechGovind:fix/inspectable-additional-types
Open

GtechGovind wants to merge 1 commit into
realm:mainfrom
GtechGovind:fix/inspectable-additional-types

Conversation

@GtechGovind

Copy link
Copy Markdown

Changes

I added an empty-default additional_types option to valid_ibinspectable so projects can explicitly allow supported typealiases such as CLLocationDegrees.

The option matches exact written type names. Configuring Angle does not implicitly allow Angle? or Angle!; those spellings must be listed separately if supported. Existing built-in types and property checks remain unchanged. This does not resolve aliases semantically or verify Interface Builder compatibility for configured names.

I added configured examples covering default rejection, qualified names, duplicates, optional spellings, existing built-ins, immutable properties, missing annotations, and explicit read-only getters. Configuration tests cover severity compatibility and invalid option values. The generated default configuration and changelog are updated.

Closes #1925.

Validation

  • swift run swiftlint-dev rules register — regenerated configuration successfully.
  • swift test --filter ValidIBInspectable — generated-rule suite and three configuration tests passed.
  • swift test — passed locally on macOS.
  • swift run swiftlint — zero violations.

The changelog intentionally retains the two trailing spaces required by CONTRIBUTING. I have not run the separate Xcode, Bazel, Docker/Linux, or Windows matrix locally; those checks remain for remote CI.

@SwiftLintBot

Copy link
Copy Markdown
20 Messages
📖 Building this branch resulted in a binary size of 28777.46 KiB vs 28755.54 KiB when built on main (0% larger).
📖 Linting Aerial with this PR took 0.68 s vs 0.67 s on main (1% slower).
📖 Linting Alamofire with this PR took 0.97 s vs 0.96 s on main (1% slower).
📖 Linting Brave with this PR took 5.48 s vs 5.43 s on main (0% slower).
📖 Linting Brigade with this PR took 18.2 s vs 18.22 s on main (0% faster).
📖 Linting DuckDuckGo with this PR took 33.82 s vs 33.47 s on main (1% slower).
📖 Linting Firefox with this PR took 11.94 s vs 11.91 s on main (0% slower).
📖 Linting Kickstarter with this PR took 7.38 s vs 7.36 s on main (0% slower).
📖 Linting Moya with this PR took 0.37 s vs 0.38 s on main (2% faster).
📖 Linting NetNewsWire with this PR took 2.6 s vs 2.58 s on main (0% slower).
📖 Linting Nimble with this PR took 0.56 s vs 0.56 s on main (0% slower).
📖 Linting PocketCasts with this PR took 7.43 s vs 7.47 s on main (0% faster).
📖 Linting Quick with this PR took 0.36 s vs 0.36 s on main (0% slower).
📖 Linting Realm with this PR took 2.96 s vs 2.97 s on main (0% faster).
📖 Linting Sourcery with this PR took 1.63 s vs 1.66 s on main (1% faster).
📖 Linting Swift with this PR took 4.64 s vs 4.62 s on main (0% slower).
📖 Linting SwiftLintPerformanceTests with this PR took 0.18 s vs 0.18 s on main (0% slower).
📖 Linting VLC with this PR took 1.45 s vs 1.46 s on main (0% faster).
📖 Linting Wire with this PR took 16.62 s vs 16.68 s on main (0% faster).
📖 Linting WordPress with this PR took 10.73 s vs 10.74 s on main (0% faster).

Generated by 🚫 Danger

@GtechGovind
GtechGovind marked this pull request as ready for review October 18, 2026 16:16

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

Support for typealiases in valid_ibinspectable

2 participants