Skip to content

Adds Variable Shadowing Rule#6568

Merged
SimplyDanny merged 18 commits intorealm:mainfrom
nadeemnali:feature/variable-shadowing-rule
Apr 13, 2026
Merged

Adds Variable Shadowing Rule#6568
SimplyDanny merged 18 commits intorealm:mainfrom
nadeemnali:feature/variable-shadowing-rule

Conversation

@nadeemnali
Copy link
Copy Markdown
Contributor

@nadeemnali nadeemnali commented Mar 30, 2026

Summary

Adds a new variable_shadowing rule that detects when a variable declaration shadows an identifier from an outer scope.

Changes

  • New Rule: VariableShadowingRule.swift - flags variable declarations that shadow outer scope identifiers
  • Registration: Added to BuiltInRules.swift
  • Tests: Added generated tests in GeneratedTests_10.swift
  • Configuration: Updated default_rule_configurations.yml
  • Documentation: Updated CHANGELOG.md

Example

var outer: String = "hello"
func test() {
    let outer = "world"  // ❌ Violates rule
}

Resolves #6228

@SwiftLintBot
Copy link
Copy Markdown

SwiftLintBot commented Mar 30, 2026

8689 Warnings
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/Settings panels/SourcesViewController.swift:194:20: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/Settings panels/SourcesViewController.swift:207:20: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/VideosViewController.swift:203:19: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/VideosViewController.swift:210:16: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/VideosViewController.swift:417:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Resources/MainUI/VideosViewController.swift:574:24: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Music/Music.swift:101:28: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Music/Music.swift:104:28: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Music/Music.swift:107:28: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/AerialVideo.swift:171:16: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/VideoLoader.swift:104:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/VideoLoader.swift:105:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/VideoLoader.swift:177:19: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/VideoDownload.swift:213:21: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/VideoDownload.swift:233:19: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/VideoCache.swift:151:27: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/VideoCache.swift:196:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/VideoCache.swift:223:19: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/VideoCache.swift:223:67: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/VideoCache.swift:302:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/VideoCache.swift:357:19: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/VideoCache.swift:366:19: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/Cache.swift:177:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/Cache.swift:260:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/Cache.swift:689:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Cache/Cache.swift:715:21: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Time/Solar.swift:200:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Aerial.swift:31:16: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Aerial.swift:33:23: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/Source.swift:198:25: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/Source.swift:201:25: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Models/Sources/SourceList.swift:221:27: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/PrefPanel/CheckCellView.swift:42:19: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Controllers/CustomVideoController.swift:494:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/LocationLayer.swift:94:21: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/LocationLayer.swift:96:21: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/Layers/LocationLayer.swift:97:21: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/AerialView.swift:367:19: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Aerial: /Aerial/Source/Views/AerialView.swift:786:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/ParameterEncoder.swift:50:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/ParameterEncoder.swift:59:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/ParameterEncoder.swift:79:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/ParameterEncoder.swift:163:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Example/Source/MasterViewController.swift:54:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Example/Source/DetailViewController.swift:94:20: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Example/Source/DetailViewController.swift:109:16: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Example/Source/DetailViewController.swift:113:23: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/URLConvertible+URLRequestConvertible.swift:98:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Session.swift:215:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Session.swift:316:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Session.swift:365:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Session.swift:430:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Session.swift:466:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Session.swift:611:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Session.swift:648:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Session.swift:777:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Session.swift:835:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Session.swift:896:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Session.swift:1122:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Session.swift:1173:28: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/ParameterEncoding.swift:164:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/ParameterEncoding.swift:200:29: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/ParameterEncoding.swift:204:25: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/ParameterEncoding.swift:276:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/ParameterEncoding.swift:308:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/DownloadRequest.swift:413:29: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/DownloadRequest.swift:415:29: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/HTTPHeaders.swift:101:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/OfflineRetrier.swift:40:16: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/OfflineRetrier.swift:42:23: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/SessionDelegate.swift:238:19: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/SessionDelegate.swift:302:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/DataRequest.swift:294:29: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/DataRequest.swift:296:29: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/CachedResponseHandler.swift:87:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/RedirectHandler.swift:91:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/NetworkReachabilityManager.swift:97:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/NetworkReachabilityManager.swift:132:19: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/NetworkReachabilityManager.swift:146:19: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/NetworkReachabilityManager.swift:198:21: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/NetworkReachabilityManager.swift:207:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Request.swift:498:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Request.swift:707:23: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Request.swift:733:23: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Request.swift:754:23: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Request.swift:780:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Request.swift:925:20: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Request.swift:950:20: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Request.swift:971:24: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Request.swift:999:24: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Request.swift:1026:24: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Core/Request.swift:1055:24: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/MultipartUpload.swift:34:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/Validation.swift:49:20: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/Validation.swift:49:49: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/Concurrency.swift:924:14: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/Concurrency.swift:924:22: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/AuthenticationInterceptor.swift:259:23: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/AuthenticationInterceptor.swift:307:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/Combine.swift:107:23: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/Combine.swift:327:23: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/Combine.swift:476:23: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/URLEncodedFormEncoder.swift:594:21: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/URLEncodedFormEncoder.swift:609:20: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/URLEncodedFormEncoder.swift:620:20: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/URLEncodedFormEncoder.swift:649:16: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Source/Features/URLEncodedFormEncoder.swift:843:21: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/UploadTests.swift:492:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/UploadTests.swift:564:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/DownloadTests.swift:280:19: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestTests.swift:1497:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/RequestTests.swift:1503:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/SessionTests.swift:49:21: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/SessionTests.swift:76:21: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/SessionTests.swift:145:25: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/SessionTests.swift:168:25: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/SessionTests.swift:1698:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/SessionTests.swift:1741:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/SessionTests.swift:1788:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/ParameterEncodingTests.swift:167:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/ParameterEncodingTests.swift:179:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/ParameterEncodingTests.swift:191:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/ParameterEncodingTests.swift:239:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/ParameterEncodingTests.swift:252:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/ServerTrustEvaluatorTests.swift:130:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/RetryPolicyTests.swift:42:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Alamofire: /Tests/TLSEvaluationTests.swift:87:16: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/BraveWidgets/ShortcutsWidget.swift:94:12: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/l10n/tools/download-translations-from-transifex.swift:138:15: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/l10n/tools/download-translations-from-transifex.swift:160:15: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/Shared/OpenInBraveViewController.swift:60:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/Shared/OpenInBraveViewController.swift:68:17: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/iOS/Delegates/AppState.swift:130:11: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Plugins/LoggerPlugin/LoggerPlugin.swift:13:15: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Plugins/IntentBuilderPlugin/IntentBuilderPlugin.swift:13:15: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/DataTests/FavoriteTests.swift:15:9: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/iOS/Delegates/SceneDelegate.swift:121:9: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/iOS/Delegates/SceneDelegate.swift:137:31: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/iOS/Delegates/SceneDelegate.swift:143:11: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/iOS/Delegates/SceneDelegate.swift:196:11: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/iOS/Delegates/SceneDelegate.swift:233:15: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/iOS/Delegates/SceneDelegate.swift:507:15: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/App/iOS/Delegates/SceneDelegate.swift:751:13: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/CertificateUtilitiesTests/CertificatePinningTest.swift:37:16: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/CertificateUtilitiesTests/CertificatePinningTest.swift:78:16: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/ClientTests/NetworkManagerTests.swift:35:12: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/ClientTests/NetworkManagerTests.swift:77:14: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/ClientTests/SolanaProviderScriptHandlerTests.swift:59:15: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/ClientTests/SolanaProviderScriptHandlerTests.swift:85:15: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ This PR introduced a violation in Brave: /ios/brave-ios/Tests/ClientTests/SolanaProviderScriptHandlerTests.swift:159:15: Warning: Do not shadow variables declared in outer scopes (variable_shadowing)
⚠️ Danger found 8689 violations with this PR. Due to GitHub's max issue comment size, the number shown has been truncated to 150.
19 Messages
📖 Building this branch resulted in a binary size of 27560.34 KiB vs 27495.63 KiB when built on main (0% larger).
📖 Linting Aerial with this PR took 0.81 s vs 0.81 s on main (0% slower).
📖 Linting Alamofire with this PR took 1.05 s vs 1.06 s on main (0% faster).
📖 Linting Brave with this PR took 7.26 s vs 7.26 s on main (0% slower).
📖 Linting DuckDuckGo with this PR took 27.94 s vs 27.83 s on main (0% slower).
📖 Linting Firefox with this PR took 12.16 s vs 12.07 s on main (0% slower).
📖 Linting Kickstarter with this PR took 8.34 s vs 8.36 s on main (0% faster).
📖 Linting Moya with this PR took 0.45 s vs 0.47 s on main (4% faster).
📖 Linting NetNewsWire with this PR took 2.62 s vs 2.61 s on main (0% slower).
📖 Linting Nimble with this PR took 0.7 s vs 0.68 s on main (2% slower).
📖 Linting PocketCasts with this PR took 7.78 s vs 7.8 s on main (0% faster).
📖 Linting Quick with this PR took 0.46 s vs 0.45 s on main (2% slower).
📖 Linting Realm with this PR took 3.03 s vs 3.04 s on main (0% faster).
📖 Linting Sourcery with this PR took 1.9 s vs 1.87 s on main (1% slower).
📖 Linting Swift with this PR took 4.7 s vs 4.69 s on main (0% slower).
📖 Linting SwiftLintPerformanceTests with this PR took 0.35 s vs 0.34 s on main (2% slower).
📖 Linting VLC with this PR took 1.23 s vs 1.25 s on main (1% faster).
📖 Linting Wire with this PR took 18.81 s vs 18.76 s on main (0% slower).
📖 Linting WordPress with this PR took 12.73 s vs 12.69 s on main (0% slower).

Generated by 🚫 Danger

Copy link
Copy Markdown
Collaborator

@SimplyDanny SimplyDanny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one! Glad to see that DeclaredIdentifiersTrackingVisitor is used for more advanced rules.

@nadeemnali nadeemnali force-pushed the feature/variable-shadowing-rule branch 3 times, most recently from 3553d5d to eb602f2 Compare April 8, 2026 11:12
@nadeemnali nadeemnali force-pushed the feature/variable-shadowing-rule branch from 5bcb7bf to fd51bd2 Compare April 10, 2026 09:56
@nadeemnali nadeemnali force-pushed the feature/variable-shadowing-rule branch from bcd25dd to d28ac00 Compare April 11, 2026 20:38
@SimplyDanny SimplyDanny enabled auto-merge (squash) April 13, 2026 17:47
@SimplyDanny SimplyDanny merged commit 949cfe9 into realm:main Apr 13, 2026
25 checks passed
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.

Warning for local variable shadowing

3 participants