Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The current directory changes for the entire process after calling this plugin #157

Closed
revolter opened this issue Mar 18, 2021 · 0 comments · Fixed by #158
Closed

The current directory changes for the entire process after calling this plugin #157

revolter opened this issue Mar 18, 2021 · 0 comments · Fixed by #158
Assignees

Comments

@revolter
Copy link

Currently, if you're using the directory option, after calling a lint method on this plugin, the current directory remains changed to the specified value, even for other plugins.

It is caused by this line:

Dir.chdir options.delete(:pwd) if options.key? :pwd

A workaround for this is:

current_dir = Dir.pwd()

swiftlint.directory = 'MyDirectory'
swiftlint.lint_files

Dir.chdir(current_dir)

(Moved from ashfurrow/danger-swiftlint#4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants