Skip to content

Excluded syntax not working anymore in 0.58.0 #5953

Closed

Description

@dtodereanfourthline

New Issue Checklist

Bug Description

We are using swiftlint in our project for years. In the .swiftlint.yml file we were excluding some folders.
In the latest release this doesn't work anymore and swiftlint tries to correct all files from the ThirdParty folders.

excluded:
  - "ThirdParty/**"
  - "*/ThirdParty/**"
  - "**/ThirdParty/**"

Mention the command or other SwiftLint integration method that caused the issue. Include stack traces or command output.

  swiftlint --fix --config "../.swiftlint.yml"
  swiftlint --no-cache --config "../.swiftlint.yml"

Environment

  • SwiftLint version: 0.58.0
  • Xcode version: Xcode 16.2 Build version 16C5013f
  • Installation method used: Homebrew
  • Configuration file:
excluded:
  - "ThirdParty/**"
  - "*/ThirdParty/**"
  - "**/ThirdParty/**"

Activity

  1. bilalb commented on Jan 13, 2025

    @bilalb

    Same here

  2. timath98 commented on Jan 13, 2025

    @timath98

    Same here too :'(

  3. pinned this issue on Jan 13, 2025
  4. SimplyDanny commented on Jan 13, 2025

    @SimplyDanny
    Collaborator

    What is a typical file path that gets linted while it shouldn't?

    Please also provide your include and exclude patterns together with the command you are executing (like @dtodereanfourthline did).

  5. dtodereanfourthline commented on Jan 14, 2025

    @dtodereanfourthline
    Author

    example file path MyProject/ThirdParty/Lottie/Private/Model/DotLottie/ZipFoundation/Archive+Writing.swift. Literally everything under ThirdParty, thousands of files.

  6. lucasecf commented on Jan 14, 2025

    @lucasecf

    I'm affected by this as well.

    excluded files:

    excluded:
      - Generated
      - <package-name>/Sources/<package-name>/Services/Networking/GraphQL/Generated/*
      - "**/Package.swift"
    

    command:
    swiftlint lint <workspace-path> --config <workspace-path>/.swiftlint.yml --quiet --reporter json

    What's funny is that I cannot reproduce locally, not sure why - on my machine, the files are properly excluded, but on CI they are not (both cases using 0.58.0 and using same command), so hundreds or warnings are reported there

  7. dtodereanfourthline commented on Jan 14, 2025

    @dtodereanfourthline
    Author

    My team has just observed that if we add the following syntax, everything works. So this means that most probably wildcards are not working anymore in the latest release.

    excluded:
      - MyProject/ThirdParty
    
  8. added this to the 0.58.1 milestone on Jan 14, 2025
  9. SimplyDanny commented on Jan 15, 2025

    @SimplyDanny
    Collaborator

    For the time being, I've reverted the change that was causing the regression. File filtering will hopefully work as normal again in 0.58.1.

  10. bilalb commented on Jan 16, 2025

    @bilalb

    Thank you @SimplyDanny
    When can we expect 0.58.1 to be available via Homebrew?

  11. dtodereanfourthline commented on Jan 16, 2025

    @dtodereanfourthline
    Author

    Thank you! :)

  12. SimplyDanny commented on Jan 16, 2025

    @SimplyDanny
    Collaborator

    Thank you @SimplyDanny When can we expect 0.58.1 to be available via Homebrew?

    There you go.

  13. unpinned this issue on Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions