-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Ability to add SwiftLint Preemptively before .Swift files have been added #2608
Comments
You could add just a dummy Swift file too. Another option would be adding a new option to |
I'd rather not add this configurability to the CLI flags. My philosophy on SwiftLint is that a properly configured project with no violations should pass just by running Perhaps a configuration file key would be more appropriate? |
@jpsim - I like that approach, as you mention a correctly configured project with no violations should pass just by running |
I think there's a broader choice to discuss which is wether or not we should treat linting no Swift files as an error or not. See #2619 where this is also being discussed but for other reasons. /cc @fabb The argument for exiting with an error code is that if you're expecting to lint a bunch of files and SwiftLint is misconfigured, it's a bit misleading to say "all good". Open to discussing this though since I think the points here and in #2619 are valid. |
I would be happy if there just was a separate exit code for the „no files“ case. |
A specific config entry for |
This is popping up as an issue when using a CI check like Danger, where editing only files that are covered by the ignore triggers a failure (danger/swift#231).
|
I created a draft PR at #2732 to see if it's satisfactory to get around this |
Same problem here. I'm running |
Implemented in #2732 |
New Issue Checklist
Describe the bug
If no .Swift files have been added to the directory then the build will fail with 'No lintable files found at paths'.
This is the correct behaviour currently but it would be nice to add the configuration to a lib/framework before any swift files have been added to the project.
At the moment I am looking at creating a shared framework that builds across iOS, OSX and TVOS. The workspace will use a shared structure for the source files and tests but I would also like to prepare the individual targets for each iOS, OSX and TVOS for SwiftLint without the build failing.
I can edit the run script to check for this manually but wondered if there is a better way around this.
The text was updated successfully, but these errors were encountered: