nerdctl icon indicating copy to clipboard operation
nerdctl copied to clipboard

Lint with `shellcheck`

Open abitrolly opened this issue 1 year ago • 5 comments

fd -e sh finds all files with .sh extension and passes the names to shellcheck.

abitrolly avatar Jun 22 '24 08:06 abitrolly

thank you @abitrolly , shellcheck CI is failing

fahedouch avatar Jun 22 '24 12:06 fahedouch

@fahedouch fixed all the warnings.

abitrolly avatar Jun 22 '24 18:06 abitrolly

Any ideas why rootless tests fail?

abitrolly avatar Jun 22 '24 20:06 abitrolly

Reverting https://github.com/abitrolly/nerdctl/commit/87d83faa5a1281c87946afdb5319ba4e60ca5061 didn't help.

abitrolly avatar Jun 24 '24 21:06 abitrolly

Reverting 4191964f849c03c8864c38efb604f0c5a65a7804 doesn't seem to help either.

@fahedouch lint warnings fixed. Any ideas why rootless tests fail?

abitrolly avatar Jun 24 '24 21:06 abitrolly

Hey @abitrolly

I have been working on something similar, introducing shellcheck as a Makefile target: #3213 - and fixing some of the issues here: #3214

This is clearly duplicating your effort here - I am really sorry about that, as I had not noticed your PR.

I am of course happy to close my PRs if you want to carry yours forward and fix the rootless issue.

LMK your thoughts.

apostasie avatar Jul 13 '24 16:07 apostasie

Reverting 4191964 doesn't seem to help either.

@fahedouch lint warnings fixed. Any ideas why rootless tests fail?

Yes. You are quoting the extra arguments for containerd, which will break the startup call with systemd.

apostasie avatar Jul 13 '24 16:07 apostasie

@apostasie you clearly possess more knowledge than I in bash shenanigans. So feel free to commit another more clear PR and I'll close this. Or maybe you will find it easier to commit here, if you're among maintainers.

I am just blindly obeying shellcheck instructions. )

abitrolly avatar Jul 13 '24 18:07 abitrolly

@abitrolly Yeah, bash and I have been in a love/hate/want-to-kill-you type of relationship for a long time :P

I am not a maintainer so cannot merge. Let see what I can get in on my PRs and reconvene here.

Thanks again!

apostasie avatar Jul 13 '24 20:07 apostasie

Rebased. So now there is only CI command, but also a lot of empty commits that are not removed by rebase --force --empty drop.

abitrolly avatar Jul 17 '24 15:07 abitrolly

After rebasing with --no-keep-empty, the PR now only contains CI code for enabling shellcheck.

abitrolly avatar Jul 17 '24 17:07 abitrolly