It would be nice to be able to set exclusions for certain rules. For example - exclude force_cast rule in tests only. When setting a custom rule, you can use the excluded argument to say which files to exclude using your custom rule on. This doesn't seem to work on the rules already defined (such as force_cast).
I don't want to use nested configurations, as there are multiple targets for this project and I rather not have to maintain a separate config per target when all I'm asking for is an exclusion in test files for certain rules. Also, the organization of this project make test files go underneath the target directory, so a regex such as the one used on the README under customer rules ".*Test\\.swift" is a more flexible way to handle this use case.
This is more important now especially for SwiftUI. We had to disable the rule: multiple_closures_with_trailing_closure but I only want that disabled for files that match the pattern *View.swift. This seems to not be possible yet?
Correct, this isn't possible yet. This would be a great feature to contribute for anyone interested.
This would be also useful for the file_header rule. The rule breaks for Package.swift files that require to have the swift-tools-version in the first line of the file. At the moment I would need to exclude all Package.swift files of our project which doesn't feel right. I would vouch for it.
@jpsim can you give some pointers how to implement this?
This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions!
Most helpful comment
This is more important now especially for SwiftUI. We had to disable the rule:
multiple_closures_with_trailing_closurebut I only want that disabled for files that match the pattern*View.swift. This seems to not be possible yet?