shellfire-dev / shellfire

A repository of namespaced, composable shell (bash, sh and dash) function libraries. Takes aware the pain of shell scripting, making it robust and reusable. Includes secure curl usage, JSON, XML and Debian control file parsers, dependency documentation via attributes, and more. Batteries ARE included.
https://github.com/shellfire-dev/shellfire
Other
1.2k stars 50 forks source link

Check framework with static analysis. #15

Open Anton-Latukha opened 7 years ago

Anton-Latukha commented 7 years ago

Koalaman still actively develops shellcheck.

While website version not process amount of code of shellfire I installed shellcheck locally and:

shellcheck ./executable.sh

That way we can check any amount of code. It finds moments.

I find static code analysis the most pleasant thing. It reports, and you just sit and close all that moments overlooked in a minute a dozen. And it gives links to explanations on why that check raised. It improved my shell style.

Despite Koalaman states on site that web static analysis services (CodeClimate and Codacy) has shellcheck, they probably dropped it. Because I checked-out and they not have shell supported now.

Maybe I will crawl someday to embody shellcheck with TravisCI.

Anton-Latukha commented 7 years ago

On my work: I write installer now for Nix project. It is not in shellfire, but I thought to switch several times. It is plain sh, at least for now, because that installer as part of oneliner, needs to be very understandable for community and people that look in oneliner before launch. And community is hostile to me, while their Linux installer is a leftover in the project, and not works. They sit inside macOS or NixOS and not know/touch Linux much. And Linux people not enter community, because they hit bugs on install. They will definitely not accept and be scared if I submit 5 000 shellfire script right away. Or maybe they will see at it, like someone legitimate came to them.

If it starts to grow further, with code, requirements, and complexity, I would raise a question to use shellfire. At least, initial oneliner can be simple sh, and installer can be shellfire level. We see how it goes and how complex installer will get.

Can I receive review once, if I send you my work, and so I improve my understanding and style of shell and compatibility? Please. If you point-out couple of things right inside code - I will diff, and it will be quite a thing for me. Because, as always, I am thinking "it is the best script in the world" 8) Because I am just a lone wolf that has no place, so I have no one to check/support me. So I have echo-chamber problem.

It also going to help me and this refreshed installer to be accepted to Nix.

raphaelcohn commented 6 years ago

Hmmm... interesting idea. I gave up on NixOS some time back, but incorporated some of their thinking into Libertine Linux. It might be worth taking the core ideas from shellfire and using them for an installer - for example, the checks in init.sh and the boilerplate code for finding the current directory.

Libertine Linux is built from source (in practice, from sources versioned using git for maximum reproducibility) using shellfire and nothing else. Builds its own bootstrap toolchain, even.

Anton-Latukha commented 6 years ago

I going to check-out. I read about it, on your page and before.


It is probably understandable why I involved in Nix Linux installation.

Let's hope that everything there would move forward and now.

BTW: this is my PR there: https://github.com/NixOS/nix/pull/1565, if something.

I am interested: Why you gave up?