Description
environment
mac os: 15.2
version: 3.21.1
description
I encountered an issue where, if the Dangerfile is not located in the root directory, SwiftLint does not correctly recognize the file paths. After reviewing the library's code, it seems there is no option to change the working directory for executing the SwiftLint command.
steps to reproduce
example: https://github.com/taise-hikawa/danger-sample
if you add SwiftLint.lint(inline: true, configFile: "../.swiftlint.yml")
to Dangerfile.swift
and try following command at ./LocalPackage
directory, you can get following error messages.
swift run danger-swift pr https://github.com/taise-hikawa/danger-sample/pull/2 --verbose
error messages
Could not read contents of `/Users/hikawataisei/Desktop/code/private/danger-sample/LocalPackage/LocalPackage/Dangerfile.swift`
Could not read contents of `/Users/hikawataisei/Desktop/code/private/danger-sample/LocalPackage/LocalPackage/Package.swift`
Could not read contents of `/Users/hikawataisei/Desktop/code/private/danger-sample/LocalPackage/LocalPackage/Sources/DangerTarget/Fake.swift`
Could not read contents of `/Users/hikawataisei/Desktop/code/private/danger-sample/LocalPackage/LocalPackage/Sources/Hoge/HogeView.swift`
Could not read contents of `/Users/hikawataisei/Desktop/code/private/danger-sample/LocalPackage/danger-sample/DangerSampleApp.swift`
It appears this might be a bug in the Danger library. Could you please look into this? Let me know if you need any further details.
Thank you for your time and help.