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

Disabling default patterns if the option --patterns-from-stdin is given #1801

Merged
merged 11 commits into from
Feb 13, 2023
Merged

Disabling default patterns if the option --patterns-from-stdin is given #1801

merged 11 commits into from
Feb 13, 2023

Conversation

mfederczuk
Copy link
Contributor

Description

Simple change to not add the default patterns if the CLI option --patterns-from-stdin is given.

This PR fixes issue #1793.

Checklist

  • PR description added
  • tests are added
  • KtLint has been applied on source code itself and violations are fixed
  • documentation is updated
  • CHANGELOG.md is updated

Instead, they will now only be added in `FileUtils.fileSequence()`.

Better anyway to only add them in one place so it's easier to keep track
of it and have a better overview.
Copy link
Collaborator

@paul-dingemans paul-dingemans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tnx for your contribution. Please address the review remarks.

…lt-patterns-if-read-patterns-from-stdin' into pr/1801

# Conflicts:
#	CHANGELOG.md
#	ktlint/src/main/kotlin/com/pinterest/ktlint/internal/FileUtils.kt
#	ktlint/src/main/kotlin/com/pinterest/ktlint/internal/KtlintCommandLine.kt
#	ktlint/src/test/kotlin/com/pinterest/ktlint/SimpleCLITest.kt
…terns are now specified via the "patterns" parameter when needed.
@paul-dingemans
Copy link
Collaborator

This didn't work out as I expected. There is no need for the fileSequence to receive two different lists of patterns. I have modified your solution. Can you have a look at my changes?

@mfederczuk
Copy link
Contributor Author

There is no need for the fileSequence to receive two different lists of patterns.

Yes, to be honest I also didn't like that solution, I just didn't know how to properly change fileSequence() without breaking tests and other behavior.
Now it looks much better.

I'd say like this it's ready to be merged.

@paul-dingemans paul-dingemans merged commit 984b94f into pinterest:master Feb 13, 2023
@paul-dingemans
Copy link
Collaborator

Merged. Tnx for the collaboration.

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.

2 participants