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

Separate out into a library? #33

Open
sunshowers opened this issue May 30, 2020 · 1 comment
Open

Separate out into a library? #33

sunshowers opened this issue May 30, 2020 · 1 comment

Comments

@sunshowers
Copy link

Hi there!

shellharden looks fantastic, and I was considering integrating it into some lint infrastructure we have. However, it looks like the only stable interface is a binary. Would you consider separating out the checks into a library and providing a Rust API as well?

A bonus would be if you could read files from memory rather than the file system -- perhaps via a trait that specifies how files should be read.

I do something similar for a tool I'm the primary author of, cargo-guppy, where there's both a Rust interface (guppy) and a CLI tool (cargo-guppy).

Thank you!

@anordal
Copy link
Owner

anordal commented Apr 19, 2021

I could do this if there is a compelling use case.

A minor concern is that the inner interface is rather low-level and would seem clumsy to a developer that is not performance obsessed (it is a state machine that reads a buffer and returns its progress and any alternative text). What this should be suitable for is IDE integration.

The bigger concern is that Shellharden is an expert at breaking scripts, and that everyone who hasn't read the warning about that would think it was a bug, and not the deal about using it. It is important to tell end users about the alternative ways of doing things that gets you out of these situations. After all, it comes with a manual. This is again a bit use case dependent.

For lint purposes – the domain of ShellCheck – I normally recommend that. I'm not trying to compete with it.

Thanks for the encouragement!

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

No branches or pull requests

2 participants