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

Indentation style #5144

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Indentation style #5144

wants to merge 11 commits into from

Conversation

mredig
Copy link
Contributor

@mredig mredig commented Jul 25, 2023

Add rule indentation_style. Warns when tabs and spaces are mixed within the same file and allows for setting your entire project to either tabs OR spaces. Also allows for spaces to finesse placement at the end of a tabbed indentation.

I'll admit that I'm a little apprehensive about this PR because I feel like this feature should somehow already be here, but I cannot figure out how to use it if it is. Either way, I hope it's helpful!

@SwiftLintBot
Copy link

SwiftLintBot commented Jul 25, 2023

2037 Warnings
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/FaviconsTests.swift:134:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/FaviconsTests.swift:135:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/FaviconsTests.swift:136:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/FaviconsTests.swift:137:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/FaviconsTests.swift:138:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/FaviconsTests.swift:140:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/FaviconsTests.swift:141:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/FaviconsTests.swift:142:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/FaviconsTests.swift:144:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/FaviconsTests.swift:145:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/FaviconsTests.swift:146:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/FaviconsTests.swift:147:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/FaviconsTests.swift:148:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/FaviconsTests.swift:150:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/FaviconsTests.swift:151:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/FaviconsTests.swift:153:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/FaviconsTests.swift:154:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in DuckDuckGo: /DuckDuckGoTests/FaviconsTests.swift:155:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/firefox-ios-tests/Tests/ClientTests/TelemetryWrapperTests.swift:460:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/firefox-ios-tests/Tests/UITests/AuthenticationTests.swift:16:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/firefox-ios-tests/Tests/UITests/AuthenticationTests.swift:24:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/firefox-ios-tests/Tests/UITests/AuthenticationTests.swift:46:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in Firefox: /firefox-ios/firefox-ios-tests/Tests/UITests/AuthenticationTests.swift:95:1: warning: Indentation Style Violation: Code should be indented with spaces (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Package.swift:28:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Package.swift:30:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Package.swift:31:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Package.swift:32:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Package.swift:34:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Package.swift:35:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Package.swift:36:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Package.swift:37:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Package.swift:38:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Package.swift:39:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Package.swift:40:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Package.swift:50:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Package.swift:51:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Package.swift:52:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Package.swift:56:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:1249:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:1250:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:1259:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:1260:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:1261:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:1266:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:1267:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:1268:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:1269:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:1271:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:232:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:233:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:234:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:235:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:236:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:237:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:238:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:239:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:321:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:56:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:68:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:973:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:974:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:977:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Account.swift:978:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountBehaviors.swift:13:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountBehaviors.swift:14:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountBehaviors.swift:15:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountBehaviors.swift:22:2: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountBehaviors.swift:27:2: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountBehaviors.swift:32:2: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountBehaviors.swift:42:2: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:111:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:21:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:22:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:27:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:368:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:369:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:370:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:371:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:372:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:373:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:374:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:375:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:376:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:377:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:378:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:379:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:380:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:381:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:382:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:383:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:384:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:385:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:386:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:387:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:388:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:389:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:390:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:391:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:392:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:393:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:394:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:395:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:396:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:397:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:398:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:399:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:400:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:401:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:402:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:403:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:404:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:405:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/AccountManager.swift:406:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/CloudKit/CloudKitAccountDelegate.swift:575:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/CloudKit/CloudKitAccountZone.swift:263:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/CloudKit/CloudKitAccountZone.swift:28:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/CloudKit/CloudKitAccountZone.swift:29:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/CloudKit/CloudKitAccountZone.swift:31:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/CloudKit/CloudKitAccountZone.swift:52:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/CloudKit/CloudKitAccountZone.swift:53:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/CloudKit/CloudKitAccountZone.swift:56:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/CloudKit/CloudKitAccountZone.swift:91:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/CloudKit/CloudKitReceiveStatusOperation.swift:38:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/Container.swift:32:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/ContainerIdentifier.swift:60:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/ContainerIdentifier.swift:61:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/ContainerIdentifier.swift:62:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/ContainerIdentifier.swift:63:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/ContainerIdentifier.swift:64:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/ContainerIdentifier.swift:66:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/ContainerIdentifier.swift:67:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/ContainerIdentifier.swift:68:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/ContainerIdentifier.swift:69:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/ContainerIdentifier.swift:78:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/ContainerIdentifier.swift:79:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ This PR introduced a violation in NetNewsWire: /Account/Sources/Account/ContainerIdentifier.swift:84:1: warning: Indentation Style Violation: Code should be indented with tabs (In this file) (indentation_style)
⚠️ Danger found 2037 violations with this PR. Due to GitHub's max issue comment size, the number shown has been truncated to 136.
17 Messages
📖 Linting Aerial with this PR took 1.16s vs 1.12s on main (3% slower)
📖 Linting Alamofire with this PR took 1.63s vs 1.6s on main (1% slower)
📖 Linting Brave with this PR took 9.38s vs 9.3s on main (0% slower)
📖 Linting DuckDuckGo with this PR took 4.76s vs 4.73s on main (0% slower)
📖 Linting Firefox with this PR took 11.25s vs 11.24s on main (0% slower)
📖 Linting Kickstarter with this PR took 11.07s vs 11.07s on main (0% slower)
📖 Linting Moya with this PR took 0.62s vs 0.62s on main (0% slower)
📖 Linting NetNewsWire with this PR took 3.16s vs 3.18s on main (0% faster)
📖 Linting Nimble with this PR took 0.9s vs 0.91s on main (1% faster)
📖 Linting PocketCasts with this PR took 8.97s vs 8.85s on main (1% slower)
📖 Linting Quick with this PR took 0.41s vs 0.4s on main (2% slower)
📖 Linting Realm with this PR took 5.72s vs 5.73s on main (0% faster)
📖 Linting Sourcery with this PR took 2.72s vs 2.71s on main (0% slower)
📖 Linting Swift with this PR took 5.61s vs 5.57s on main (0% slower)
📖 Linting VLC with this PR took 1.51s vs 1.51s on main (0% slower)
📖 Linting Wire with this PR took 20.43s vs 20.32s on main (0% slower)
📖 Linting WordPress with this PR took 13.53s vs 13.41s on main (0% slower)

Generated by 🚫 Danger

@mredig mredig marked this pull request as ready for review July 25, 2023 20:12
@Harry-KNIGHT
Copy link

Can you add code example of your PR please ?

@mredig
Copy link
Contributor Author

mredig commented Feb 20, 2024

Sorry, I don't know how this slipped through my radar. I didn't notice a response until now.

Can you add code example of your PR please ?

I'm not sure I understand what you mean. Are you asking for something like the rule description?

Copy link
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.

First a few general remarks and questions. Once they are clarified, I may check the actual implementation.

@ConfigurationElement(key: "preferred_style")
private(set) var preferredStyle = PreferredStyle.spaces
@ConfigurationElement(key: "tab_width")
private(set) var tabWidth: Int?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should have a reasonable default, shouldn't it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe it would be better with a different name. This isn't for setting how many spaces a tab should consist of, it's to tell swiftlint how wide your tabs are, since I don't think that can be derived from anywhere...

The reason being, if you are using tab indentation, sometimes you use spaces to provide a little nudging after the tab indentation. This setting allows for no more than tabWidth - 1 spaces following any tab indentation.

I'll point out that, if you are using tabs in what I consider to be the most optimal way, you don't need this. However, forcing tabs projects to use tabs my way goes entirely against the philosophy of tabs usage in the first place, so this setting now exists.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This would also be required, if the we offer an automatic rewrite for the rule.

But I wonder, what happens if it remains nil. Then the rule would have to assume something, wouldn't it? Is it better to specify 2 or 4 as defaults right away then?

@ConfigurationElement(key: "include_multiline_strings")
private(set) var includeMultilineStrings = false
@ConfigurationElement(key: "include_multiline_comments")
private(set) var includeMultilineComments = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is a good argument to exclude comments?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I recall correctly, it's because Xcode automatically indents multiline comments content with an additional space, even if you use tabs for indentation. As a tabs evangelist, even I don't always care to fix that since the smallest tweak can cause Xcode to reset that.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If trailing spaces are only used to refine the indentation, but otherwise the file's default is respected by Xcode so that either spaces or tabs are used for the main chunk of the indentation, this seems like a normal case that should be supported anyway also in other areas, e.g.

if cond1,
   cond2 {
    // ...
}

wherein cond2 might be indented by one tab and one space.

In other words, is there any reason to make this optional?

}
}

mutating func apply(configuration: Any) throws {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would prefer the auto-generated apply implementation. Is there any specific reason for this custom version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I recall correctly, I think it's for this bit:

if perFile == false {
	if let preferredStyle = configurationDict[$preferredStyle] as? String {
		self.preferredStyle = PreferredStyle(rawValue: preferredStyle) ?? .spaces
	}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

See my other suggestion about extending PreferredStyle to circumvent this special case.

case spaces

func asOption() -> OptionType {
.string(rawValue)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be .symbol(rawValue).

var violations: [StyleViolation] = []

var fileStyle: ConfigurationType.PreferredStyle?
if configuration.perFile == false {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if configuration.perFile == false {
if !configuration.perFile {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I understand the irony of me arguing any style preferences on this project, but the reason I do this is for cognitive overhead while reading code. I used to always prefer the conciseness of the bang operator for testing conditions, but another programmer shared that they found reading new code much faster when there was a big ol' false staring you in the face instead of a tiny little !.

I'll go ahead and change it, but I just wanted to share my reasoning :)

@ConfigurationElement(key: "include_multiline_comments")
private(set) var includeMultilineComments = true
@ConfigurationElement(key: "per_file")
private(set) var perFile = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure about this option. I tend to keep it simple for the first and only have a project-wide preferred setting instead of individual variants per file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've found that many projects I've come across have a hodgepodge mix. I included this so migration to project wide settings can be a little more gradual. Not to mention that Xcode allows setting tabs or spaces on a file by file basis, I don't want to cause violations in areas where teams may have already deliberately gone against the grain.

I can remove, but the work is already done!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Got that. Perhaps this can be combined with preferredStyle in the sense of having spaces, tabs and automatic (or perFile) as options?

This would have the pretty side effect, that the apply method can be auto-generated.

fileStyle = .tabs
confirmedFileStyle = .tabs
default:
queuedFatalError(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Prefer to report another violation instead of crashing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oooh smart! Blind spot there. Thanks!

identifier: "indentation_style",
name: "Indentation Style",
description: """
Indent code using either tabs or spaces, not a chaotic mix. Can be configured to per file or project wide.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I had to smile when I read the "chaotic mix". Yet, I think it's a bit too offensive for a documentation. Better leave it out. 😉

Suggested change
Indent code using either tabs or spaces, not a chaotic mix. Can be configured to per file or project wide.
Code should be indented using either tabs or spaces. Can be configured to per file or project wide.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to smile when I read the "chaotic mix"

Mission accomplished :) I can now close this PR!

Comment on lines 317 to 318
private
func previousLineSetsNonstandardIndentationExpectation(_ currentLine: Line, in file: SwiftLintFile) -> Bool {

Choose a reason for hiding this comment

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

Suggested change
private
func previousLineSetsNonstandardIndentationExpectation(_ currentLine: Line, in file: SwiftLintFile) -> Bool {
private func previousLineSetsNonstandardIndentationExpectation(_ currentLine: Line, in file: SwiftLintFile) -> Bool {

(nit) spelling

(fix) corrected PR number in changelog

(nit) ironically didn't run swiftlint to see that I needed to fix some violations

... until now

(fix) changelog values
* use `symbol` instead of `string`
* `!boolean` instead of `boolean == false`
* produce violation instead of fatalError
* More professional description
* readdressed line length on private func
* document `tab_width` usage
@mredig
Copy link
Contributor Author

mredig commented Feb 23, 2024

Hmm - Looks like there've been some substantial changes since this PR was made. Working on getting it to build and pass tests with the latest updates....

@mredig
Copy link
Contributor Author

mredig commented Feb 23, 2024

1 Error
🚫 Could not build branch
Generated by 🚫 Danger

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.

None yet

4 participants