php-malware-finder icon indicating copy to clipboard operation
php-malware-finder copied to clipboard

Clean up our main script

Open jvoisin opened this issue 7 years ago • 5 comments

Currently, our main script's code looks quite ugly. It would be nice if someone with some shell-fu could take a look at it, and clean it up.

jvoisin avatar Feb 21 '18 10:02 jvoisin

Maybe rewrite the whole thing in Go? ;) (got a working rewrite in Go, we really should test it someday!)

mdeous avatar Mar 01 '18 12:03 mdeous

Do you think a script based on the Bash3 boilerplate and trying to show little to no errors from ShellCheck would be a good idea ?

I'm worried the MIT licence from the Bash3 boilerplate can be an issue...

ahpnils avatar Mar 23 '19 23:03 ahpnils

I'm not a big fan of bringing in a whole external dependency for our simple'n'stupid bash script tbh :/

But the shellcheck idea is great, I think that we ran it on the codebase at some point.

jvoisin avatar Mar 24 '19 09:03 jvoisin

I don't see it as importing a whole external dependency, but rather using some ideas (see the Scoping, Coding style and Safety and Portability parts on b3bp website) or some parts of it. For instance, I started to :

  • switch to local variables ;
  • switch to stricts options for bash ;
  • use brace expansions.

ahpnils avatar Mar 24 '19 10:03 ahpnils

Be my guest if you want to improve the script, I'll be happy to review your PR :)

jvoisin avatar Mar 24 '19 10:03 jvoisin