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

Traversion directory tree with relative patterns referring to directories outside work directory #2002

Closed
paul-dingemans opened this issue May 8, 2023 · 0 comments · Fixed by #2004
Milestone

Comments

@paul-dingemans
Copy link
Collaborator

If Ktlint CLI is started with a glob that refers to a directory that is not a child directory of the current working directory than no files in that directory will be found. The problem seems especially to occur when using Bash as it deals differently with glob expansion.

The easiest reproduction is running ktlint ../project-directory/src/**/*.kt in some subdirectory other than project-directory.

Originally posted by @jokinol in #1600 (comment)

@paul-dingemans paul-dingemans added this to the 0.49.1 milestone May 8, 2023
paul-dingemans added a commit that referenced this issue May 9, 2023
…rrent working directory or any of it child directories

Closes #2002
paul-dingemans added a commit that referenced this issue May 9, 2023
Fix directory traversal for patterns referring to paths outside of current working directory or any of it child directories. Note that on Windows the (relative) patterns may not refer to a path outside of the current working directory.

Closes #2002
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.

1 participant