Skip to content

Add shfmt and shellcheck bits #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 24, 2025
Merged

Add shfmt and shellcheck bits #14

merged 2 commits into from
Apr 24, 2025

Conversation

meatballhat
Copy link
Contributor

Vaguely related to RUNT-11

Copy link

sh-checker report

To get the full details, please check in the job output.

shellcheck errors

'shellcheck ' returned error 1 finding the following syntactical issues:

----------

In docker-images/valkey/valkey-entrypoint/reload-certs line 5:
. /opt/valkey/entrypoint/functions
  ^-- SC1091 (info): Not following: /opt/valkey/entrypoint/functions was not specified as input (see shellcheck -x).


In docker-images/valkey/valkey-entrypoint/reload-certs line 22:
    for _ in $(seq 1 $RELOAD_INTERVAL); do
                     ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    for _ in $(seq 1 "$RELOAD_INTERVAL"); do


In docker-images/valkey/valkey-entrypoint/reload-certs line 31:
    valkey-cli $common_args --raw CONFIG GET tls-key-file | tail -n1 | head -c -1 | valkey-cli $common_args -x CONFIG SET tls-key-file
               ^----------^ SC2154 (warning): common_args is referenced but not assigned.
               ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                                               ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    valkey-cli "$common_args" --raw CONFIG GET tls-key-file | tail -n1 | head -c -1 | valkey-cli "$common_args" -x CONFIG SET tls-key-file


In docker-images/valkey/valkey-entrypoint/replication-coordinator line 5:
. /opt/valkey/entrypoint/functions
  ^-- SC1091 (info): Not following: /opt/valkey/entrypoint/functions was not specified as input (see shellcheck -x).


In docker-images/valkey/valkey-entrypoint/replication-coordinator line 12:
SENTINEL_QUORUM=$(get_sentinel_quorum ${VALKEY_REQUIRED_SENTINELS})
                                      ^--------------------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
SENTINEL_QUORUM=$(get_sentinel_quorum "${VALKEY_REQUIRED_SENTINELS}")


In docker-images/valkey/valkey-entrypoint/replication-coordinator line 33:
    valkey-cli $common_args -p 6379 REPLICAOF no one
               ^----------^ SC2154 (warning): common_args is referenced but not assigned.
               ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    valkey-cli "$common_args" -p 6379 REPLICAOF no one


In docker-images/valkey/valkey-entrypoint/replication-coordinator line 67:
    valkey-cli $common_args -p 6379 REPLICAOF ${MASTER_ADDR} ${MASTER_PORT}
               ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                              ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                             ^------------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
    valkey-cli "$common_args" -p 6379 REPLICAOF "${MASTER_ADDR}" "${MASTER_PORT}"


In redis-base/reload-certs.sh line 15:
redis-cli $redis_args --raw CONFIG GET tls-key-file | tail -n1 | head -c -1 | redis-cli $redis_args -x CONFIG SET tls-key-file
          ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                                        ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
redis-cli "$redis_args" --raw CONFIG GET tls-key-file | tail -n1 | head -c -1 | redis-cli "$redis_args" -x CONFIG SET tls-key-file


In redis-instance/reload-certs.sh line 15:
redis-cli $redis_args --raw CONFIG GET tls-key-file | tail -n1 | head -c -1 | redis-cli $redis_args -x CONFIG SET tls-key-file
          ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                                                                                        ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
redis-cli "$redis_args" --raw CONFIG GET tls-key-file | tail -n1 | head -c -1 | redis-cli "$redis_args" -x CONFIG SET tls-key-file

For more information:
  https://www.shellcheck.net/wiki/SC2154 -- common_args is referenced but not...
  https://www.shellcheck.net/wiki/SC1091 -- Not following: /opt/valkey/entryp...
  https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...
----------

You can address the above issues in one of three ways:
1. Manually correct the issue in the offending shell script;
2. Disable specific issues by adding the comment:
  # shellcheck disable=NNNN
above the line that contains the issue, where NNNN is the error code;
3. Add '-e NNNN' to the SHELLCHECK_OPTS setting in your .yml action file.



shfmt errors
'shfmt -i 4' found no issues.

@meatballhat meatballhat merged commit 80dcd91 into main Apr 24, 2025
2 checks passed
@meatballhat meatballhat deleted the shfmt-shellcheck branch April 24, 2025 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant