danger-ruby-swiftlint icon indicating copy to clipboard operation
danger-ruby-swiftlint copied to clipboard

danger-swxftlint 0.7.0 fails when specifying config file

Open valeriomazzeo opened this issue 7 years ago • 6 comments

Very odd, tested 0.6.0 and it works fine. Although, 0.7.0 works with this configuration:

swiftlint.lint_files

It does fail with this:

swiftlint.config_file = '.swiftlint.yml'
swiftlint.lint_files

The logs report fatal error but it doesn't make CI like travis fail the build and it neither report any type of error whatsoever on the pull request.

fatal error: Could not read configuration file at path '/Users/myuser/Projects/myProject/mySubProject/Sources/Auth0Provider/Authentication/Resources/SignIn.swift/.swiftlint.yml': file /Users/marcelofabri/Westfield/SwiftLint/Source/SwiftLintFramework/Models/Configuration.swift, line 167
/Users/myuser/Projects/myProject/mySubProject/Sources/Auth0Provider/Authentication/Resources/SignIn.swift/.swiftlint.yml:File not found.
fatal error: Could not read configuration file at path '/Users/myuser/Projects/myProject/mySubProject/Sources/AuthenticationProvider/Controllers/AuthenticationController.swift/.swiftlint.yml': file /Users/marcelofabri/Westfield/SwiftLint/Source/SwiftLintFramework/Models/Configuration.swift, line 167
/Users/myuser/Projects/myProject/mySubProject/Sources/AuthenticationProvider/Controllers/AuthenticationController.swift/.swiftlint.yml:File not found.

Errors are weird, not sure what's happening there. Somehow it seems there is some hardcoded path coming from swiftlint directly.

I am using the latest swiftlint 0.20.1.

valeriomazzeo avatar Jul 19 '17 08:07 valeriomazzeo

This is a SwiftLint issue, sorry about that. Filled https://github.com/realm/SwiftLint/issues/1694 to track it.

marcelofabri avatar Jul 19 '17 08:07 marcelofabri

And PR landed in https://github.com/realm/SwiftLint/pull/1695. Could you please try it to see if it solves the issue?

marcelofabri avatar Jul 19 '17 09:07 marcelofabri

Also, a current workaround for this issue is to provide an absolute path for --config.

marcelofabri avatar Jul 19 '17 13:07 marcelofabri

@marcelofabri I can try if you release an hot fix of swiftlint 0.20.2

valeriomazzeo avatar Jul 24 '17 17:07 valeriomazzeo

There are a number of ways to install SwiftLint without requiring an official release. Please see https://github.com/realm/SwiftLint#installation

Notably, brew install swiftlint --HEAD

jpsim avatar Jul 24 '17 18:07 jpsim

It seems like SwiftLint 0.21.0 has the same issue.

chooblarin avatar Aug 09 '17 22:08 chooblarin