Run shellcheck and some more manual fixes#52
Run shellcheck and some more manual fixes#52Artoria2e5 wants to merge 2 commits intokristopolous:masterfrom
Conversation
* ARGV is now an array. Should fix kristopolous#32. * Quotes and stuff, also in generated code. * Not using `...` is a good idea because it effs up badly when you nest them. It's also in shellcheck. * Catch bad args in tickVars. * * * POSIX interaction, in case people want it later: * No arrays, but we aren't gonna do the transpiling anyways. * No +=, so it's gonna be dreadfully slow for long args. Remember the quadratic string append stuff in JS? Yeah it's exactly that. * No ${var/pat/sub}, so dreadfully slow again. Prefix and suffix trimming is available though. * No (( ... )), but `: $(( ))` is the same. Except for `++`.
|
Shell check is overly pedantic linting for people who don't know how to code. I'll look into the other stuff today, thanks |
|
Yeah sorry, this is a lot. I'll cherry pick some lines but I'm not going to accept all of it. Also the idea wasn't to change the core but to have a derivative transpiler for posix |
|
also you introduced a typo ... how about this ... package up the last commit (single liner) in a separate pr and I'll merge that ... there may be some shellcheck suggestions I missed ... but yeah ... I'll have to audit that line by line |
|
Quoting is not for overly pedantic folks; it's a way to explicitly tell the shell to not attempt to split and glob the filesystem at all. Doing as little as required is good behavior, not only because it might be a tidbit faster, but also because it means messing up less. And how about your ARGV. |
|
I'm really busy, thanks for the work, I'll look into it. |
|
Totally agree. Such a huge PITA is auto linting.
With one very large Python project I'm on (dozens of contributors), when they
introduced enforced linting, all PRs and commits slowed down substantially, and
everything gets bogged down in flake8 failures and fixes.
|
...is a good idea because it effs up badly when you nest them. It's also in shellcheck.POSIX interaction, in case people want it later:
+=, so it's gonna be dreadfully slow for long args. Remember the quadratic string append stuff in JS? Yeah it's exactly that.${var/pat/sub}, so dreadfully slow again. Prefix and suffix trimming is available though.(( ... )), but[ "$(( ... ))" -ne 0 ]is the same. Except for++.<<<, so I am effing myself up.In addition,
echois a wack, but we can always roll our own withprintf.