SwiftLint icon indicating copy to clipboard operation
SwiftLint copied to clipboard

`file_types_order` stopped working with partial `order` set

Open username0x0a opened this issue 1 year ago • 1 comments
trafficstars

New Issue Checklist

Bug Description

Previously (with 0.53.0) we had the file_types_order configured like this:

file_types_order:
  order: [[SwiftLintFramework.FileType.mainType], [SwiftLintFramework.FileType.previewProvider]]

so that it only checks that the main SwiftUI type is preceding its related PreviewProvider type.

Now after updating to 0.56.1 I just noticed the values naming in the order parameter changed, so I simply updated the config with this setup:

file_types_order:
  order: [[main_type], [preview_provider]]

which should be equivalent to the previous one in new terms. Yet I'm getting a ton of warnings related to other types (like f.e. extensions between classes, structs or whatever) not defined in our configuration. I find this breaking & I'd love to continue using this rule to just check the order of the specified subset of type identifiers.

Curiously, I can't seem to find any note on a change in the changelog diff in the first place so I can't really say when exactly this change happened.

Environment

  • SwiftLint version: 0.56.1 (updating from 0.53.0)
  • Xcode version: Xcode 15 (unrelated, replicable in CLI)
  • Installation method: Homebrew

username0x0a avatar Aug 18 '24 17:08 username0x0a

Browsing through the Git history I cannot believe a value like SwiftLintFramework.FileType.mainType has ever worked. 😅

Also, that you now suddenly see more warnings doesn't really make sense.

Can you provide a very succinct example with a configuration that doesn't trigger 0.53.0 but 0.56.1? Can you even try how 0.54.0 and 0.55.0 behave?

SimplyDanny avatar Aug 20 '24 20:08 SimplyDanny

This issue has been marked as stale because it has not seen any activity in the last 4 months. It is going to be closed soon if it stays inactive.

SimplyDanny avatar Feb 15 '25 13:02 SimplyDanny

This issue is being closed due to inactivity. Please feel free to reopen if you have more information.

github-actions[bot] avatar Apr 15 '25 08:04 github-actions[bot]