-
-
Notifications
You must be signed in to change notification settings - Fork 21
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 formatters that output patch #20
Comments
Wait, I use ShellCheck all the time, and thought it was only a linter. And its README even says:
What am I missing? :-) |
It is true that its authors don't intend for ShellCheck to be used as a formatter. For some of the problems it can detect, though, ShellCheck is capable of recommending fixes. And one of the output formats ShellCheck supports is diff. That output would be sufficient to be consumed in an automated way, I I find that I typically do want to apply most or all of the fixes ShellCheck is able to recommend, and I I really like the ergonomics of defining formatters using this The feature could feasibly be useful beyond just ShellCheck, so I thought to start a conversation about including it. :) I've started working on a branch to add the feature; if you would rather hold off judgement on the value of the feature until you can demo, I'd be glad to let you know once I have an MVP. |
It's definitely something I'd consider. |
@purcell I wasn't able to figure out how to get Emacs to apply a patch in an entirely automated fashion. All of my attempts resulted in Emacs starting an interactive diff session. Do you have suggestions for how to avoid that? |
There's code floating around for programatically applying RCS-style diffs to the current buffer. That's ultimately what's needed, and ideally not just for RCS-style diffs. |
ie. the whole point is to walk the diff and then make very minimal edits in the buffer according to what the diff says. |
py-isort, py-autopep8 apply RCS patches too. Would be nice if this package could support it so I don't have to install dozens of packages to format code. |
ShellCheck is an example of a tool that doesn't support writing changes in-place, but does support
diff
-style output. Example of runningshellcheck --format=diff
against edx/devstack/course-generator/create-courses.sh:The text was updated successfully, but these errors were encountered: