chevah / pythia

Chevah's Python 3 distribution
MIT License
4 stars 2 forks source link

Shellcheck tests. #44

Closed dumol closed 1 year ago

dumol commented 1 year ago

Scope

Fixes #43

Changes

Improved existing Bash code to pass all Shellcheck tests.

Also tried to impose more uniform syntax everywhere.

Added automated Shellcheck tests for all shell scripts.

Drive-by fixes:

Testing

Automated. ;-]

But please take a look at the changes, some are non-trivial, e.g. using matrices for some variables to make it possible to quote them everywhere.

dumol commented 1 year ago

I think I've addressed the issues raised in my comments and commits above.

Do let me know if there's anything still standing. Thanks!

dumol commented 1 year ago

The Shellcheck tests are not running during the "build" phase, only during the "test" phase at the end. And you can also run them manually whenever needed.

dumol commented 1 year ago

@adiroiban, I've found more minor issues during a final own review, beyond what Shellcheck was reporting.

While reviewing, I've also realized why the check_os_version() function in pythia.sh might be so hard to understand, so I've tried to improve it. Please take a look at it at https://github.com/chevah/pythia/blob/43-shellcheck-tests/pythia.sh#L537 and let me know if it's comprehensible now. Thanks!

dumol commented 1 year ago

For the record, I've had one more attempt to move BUILD_ENV_* files to $BUILD_DIR, this time without using a single file, but I don't think it's worth the trouble.