Skip to content

'No such file or directory' when the Gemfile and Dangerfile is in a different location than the root #175

@ghost

Description

I am using Bitrise as a CI/CD tool and I have an issue when I am running Danger-swiftlint for my project:

error opening input file '/Users/vagrant/git/ios/ios/Main/fileFolder/fileWithLintError.swift' (No such file or directory)
Most rules will be skipped because sourcekitd has failed.
SourceKittenFramework/File.swift:20: Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=260 "The file “fileWithLintError.swift” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/vagrant/git/ios/ios//Main/fileFolder/fileWithLintError.swift, NSUnderlyingError=0x7fac62b05480 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}

The cause of this issue probably is a double ios value in the path because when I moved Danger and Gemfile file into the root folder it works. We are using Kotlin Multiplatform and our root folder for iOS is project_catalouge/ios/ and there is no possibility to keep these files there.

Is there any workaround for this or a way to pass a different execution path?

My Danger file setup:

swiftlint.config_file = '.swiftlint.yml'
swiftlint.binary_path = 'ios/Pods/SwiftLint/swiftlint'
swiftlint.lint_files fail_on_error: true, inline_mode: true

Bitrise job for running Danger:

    - script:
        run_if: ".IsPR"
        inputs:
        - content: |-
            #!/bin/bash
            set -ex
            bundle exec danger --fail-on-errors=true
        - working_dir: "$BITRISE_SOURCE_DIR/ios"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions