biox / pa

a simple password manager. encryption via age, written in portable posix shell
https://passwordass.org
Other
506 stars 21 forks source link

gh-action to enable shell check in PR #30

Closed mbauhardt closed 4 months ago

mbauhardt commented 4 months ago

why

Running shell check against changed scripts within a PR is helpful to detect linting issues upfront.

what

Added a workflow which runs against all relevant shellscripts and fail when an error is detected.

arcxio commented 4 months ago

this is way too much infrastructure just to run shellcheck for my taste, but I'll let @biox be the judge

mbauhardt commented 4 months ago

@arcxio whats your recommendation except having nothing?

arcxio commented 4 months ago

pash actually has a workflow exactly for this purpose and it looks much simpler: https://github.com/dylanaraps/pash/blob/master/.github/workflows/main.yml can it be reused or is there something missing? (it doesn't seem to be working, though, I don't see any workflow runs in the repo... but maybe it's because it's archived) and if it were to be added, I'd say it would also need to run shfmt

mbauhardt commented 4 months ago

? this is the same, but without the path check. so in their action when changing for example the readme only, we would run this check as well which is not necessary. So they have less code, which is fine, but less accurate against the changeset. Anyway, if you think we are running the action independent of the change, I can remove the path check.

arcxio commented 4 months ago

what problem are you solving? if you're concerned with wasted resources on running redundant shellchecks, you instead fire up three additional containers on Ubuntu for every PR, including this "dorny/paths-filter" one made with typescript, which I bet wastes significantly more resources than shellcheck

mbauhardt commented 4 months ago

what problem are you solving?

Running shellcheck when shell-scripts were changed.

if you're concerned with wasted resources on running redundant shellchecks, you instead fire up three additional containers on Ubuntu for every PR, including this "dorny/paths-filter" one made with typescript, which I bet wastes significantly more resources than shellcheck

I don't get what your concern is. anyway, i'll remove the path check.

arcxio commented 4 months ago

can you switch to this action? it also runs shfmt and seems to be more popular and more actively maintained

mbauhardt commented 4 months ago

can you switch to this action? it also runs shfmt and seems to be more popular and more actively maintained

sure, let me take a look.

mbauhardt commented 4 months ago

would be helpful to specify what we want to achieve with that action.

A) I'm think good enough would be

B) a more complex achievement would be

I vote for A because it is simple and good enough. but sure, if we really want to have B I don't have strong emotional concerns against it.

BTW, formatting and linting are a different kind of shoes.

arcxio commented 4 months ago

if formatting changes are there commit and push the change automatically

correct me if I'm wrong but I think the action I've linked doesn't do that. it just checks that shfmt runs without errors, and PR's author has to run the formatter themselves if it doesn't.

biox commented 4 months ago

i honestly don't really want this project to depend on gha. it's simple enough that if we fuck it up, nbd someone can just push a fix. imo ci systems are for more-than-shell-script sized things. i appreciate the contribution @mbauhardt but i must politely decline.