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

Switch to different folder path

Open RishabhTayal opened this issue 7 years ago • 5 comments

Is there a way to switch to different folder path and then run swiftlint in Dangerfile and then switch back to the main folder?

For e.g.

Folder A
---- Folder B
---- Folder C

My main folder is Folder A. I want to switch to Folder B and then run swiftlint in it. My .swiftlint.yml file is inside Folder B. After swiftlint is complete, I want to switch back to Folder A.

RishabhTayal avatar May 04 '17 14:05 RishabhTayal

Hmm, I don't think that's currently possible with the tool. I believe SwiftLint is smart enough to respect the individual .swiftlint.yml files in each directory. Can you try it out and see if ti works as-is? Thanks!

ashfurrow avatar May 06 '17 14:05 ashfurrow

I tried running swiflint in the main directory and I didn't get any violations although there are known violations.

Regards, Rishabh Tayal [email protected]

On May 6, 2017, 9:35 AM -0500, Ash Furrow [email protected], wrote:

Hmm, I don't think that's currently possible with the tool. I believe SwiftLint is smart enough to respect the individual .swiftlint.yml files in each directory. Can you try it out and see if ti works as-is? Thanks!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub (https://github.com/ashfurrow/danger-swiftlint/issues/41#issuecomment-299643787), or mute the thread (https://github.com/notifications/unsubscribe-auth/ACALxgSukUj5h6ThtW2lccVqFLys2QSBks5r3IUagaJpZM4NQv1m).

RishabhTayal avatar May 06 '17 14:05 RishabhTayal

Interesting. Thanks for following up. I'll try taking a look at it but it may not be for a little while.

ashfurrow avatar May 06 '17 14:05 ashfurrow

Before you look into it I find a potential solution which should work but it doesn't. Here is the link. https://github.com/danger/danger/issues/805

RishabhTayal avatar May 06 '17 14:05 RishabhTayal

Hey @RishabhTayal did you try to use the :directory field?

The intention of this feature is precisely allow you to run swiftlint from a different directory. In your case I believe it would be like this:

Directories

Folder A
---- Folder B
---- Folder C

Dangerfile

swiftlint.directory "Folder B"
swiftlint.lint_files

swiftlint.directory "Folder C"
swiftlint.lint_files

So it would lint different folders individually.

Hope it helps

thiagofelix avatar May 16 '17 11:05 thiagofelix