You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
I got a similar issue on my end trying to run danger from a different directory like this:
DEBUG="*" swift run danger-swift ci --dangerfile ../../../Dangerfile.swift
It seems danger dsl is getting the modified paths without taking into account I'm running danger from another directory, I ended up correcting the files paths myself like this:
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")
toDangerfile.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
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.
The text was updated successfully, but these errors were encountered: