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

Support absolute paths for globs #1199

Merged
merged 6 commits into from
Aug 6, 2021
Merged

Conversation

petertrr
Copy link
Contributor

@petertrr petertrr commented Aug 6, 2021

Description

  • Support absolute paths
  • Correctly expand tilde in globs (previously was leading to concatenation of absolute paths twice)
  • Support unescaped backslashes on Windows (was working in previous versions, but was changed after migration to PathMatcher)

This closes #1131 and also two more minor issues I've discovered along the way.
I found out that PathMatcher works OK with absolute paths in globs, and based on discussion in #1131 decided that it's no more a design decision to support only relative paths. So I attempted to implement this fix. Will gladly hear any feedback.

Checklist

  • tests are added
  • CHANGELOG.md is updated

* Correctly expand tilde in globs
* Support unescaped backslashes on Windows
* Support absolute paths
* Updated CHANGELOG.md
@orchestr7
Copy link
Contributor

This should be useful. Finally we will make ktlint great again with absolute paths

* Fix compilation on Java 8
* Fix logic with tilde
@shashachu shashachu merged commit b0e4a42 into pinterest:master Aug 6, 2021
romtsn pushed a commit to paul-dingemans/ktlint that referenced this pull request Aug 8, 2021
* Support absolute paths for globs

* Correctly expand tilde in globs
* Support unescaped backslashes on Windows
* Support absolute paths

* Support absolute paths for globs

* Updated CHANGELOG.md

* Support absolute paths for globs

* Fix compilation on Java 8

* Support absolute paths for globs

* Fix logic with tilde

Co-authored-by: Sha Sha Chu <[email protected]>
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 this pull request may close these issues.

[Question] What is the reason to drop support for absolute paths in file patterns?
3 participants