YunoHost / package_linter

Linter for YunoHost applications packages
https://yunohost.org/#/packaging_apps
GNU Affero General Public License v3.0
17 stars 13 forks source link

Use a real bash parser #11

Closed Psycojoker closed 3 years ago

Psycojoker commented 7 years ago

The current work is done using simple guess that triggers false positive. We should uses a real bash parser instead to be sure that we don't have false positives, something like this one: https://github.com/idank/bashlex

M5oul commented 7 years ago

Thanks to link me this project. I will take a look.

alexAubin commented 5 years ago

Well I just gave it a try and it is far from being miraculous compared to shlex ...

Neither of those seem to be designed to handle parsing (large?) bash files ... I had to supress commented and empty line myself for it to accept running on it, and now I am facing an AssertionError right in the middle of the code's lib with no clue what's wrong ...

Line-by-line parsing is not happy either if it encounters an if (which is meant to be closed on another line)

So, nope...

Psycojoker commented 5 years ago

Meh, that sucks x(

The code still quite active if you are motivated (while I'm expecting you to have no time for that) to report a bug. It's used by https://www.explainshell.com/ so I would have expect it to be quite robust but meh.

alexAubin commented 5 years ago

Well yea those bugs are already reported (and there are even PR) since 2015~2016 ... https://github.com/idank/bashlex/issues

alexAubin commented 3 years ago

Closing because meh, the current package_linter pretty much works, there's a few issues about multiline stuff but that's not really important ... moving to another parser would imply quite a lot of refactoring I think, without so much gain