-
Notifications
You must be signed in to change notification settings - Fork 87
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 --stdin
with --fix
#497
Comments
If I understand your scenario correctly, the issue is not that those two options aren't compatible, but that you want a new feature which is to output the result of fixing a file to standard output - and presumably not also output status or information about unfixable errors. is there a reason you aren't able to do this today by using a temporary file instead? |
Yup, you are correct.
That would mean I need to run multiple commands to do one operation which means it will over-complicate the configuration above. As a reference, take a look at what I do with the
Additionally, I believe supporting |
If I understand both of your examples above, you have an existing file on disk that you want to apply fixes to. In the first example, it's files that match that pattern and then you are writing changes back to disk. In the second, it's the file being cat-ed and I assume the result is going to be redirected to some file in the next step. It seems to me that both examples should be possible today. I agree stdin-stdout is a potential workflow, but I am still not clear on when it is needed? |
Not quite correct. It's regex-matching the contents of a buffer instead of a file. (See preprocessors for more information.) So at the time that
Both of the approaches are the same so it simply reads some content from stdin and write the fixed one to stdout. It can either be redirected to a file or not.
Unfortunately it's not possible due not being able to output the result to the stdout. You can try it for yourself:
Hint: #104 (which I think should be fixed as well.) |
Hello! 👋🏼
I maintain a project called git-cliff, which is used mostly for generating changelogs in markdown format. We also support postprocessors for running certain commands after the file is generated.
My use case is to run
markdownlint-cli
to fix the styling issues like so:However, this does not work since the flags cannot be used together. I simply need to read content from stdin and print out the "fixed" content to stdout.
Would it be plausible to support this use case?
The text was updated successfully, but these errors were encountered: