taproot-assets icon indicating copy to clipboard operation
taproot-assets copied to clipboard

make: Enhance/fix go version linting

Open dstadulis opened this issue 1 year ago • 2 comments

A portability bug in BSD vs GNU sed is remediated in this PR as well as tightening up when Go version validation fails.

  • make: simplify calling Go version consistency checks
  • make: add comments to describe purpose of the linter-supporting scripts
  • make: replace non-portable use of sed with tr
  • make: replace error condition's predicate Instead of returning an error if any go version exists other than the stipulated version, require the extracted Go version to be the stipulated version
  • make: error reporting logic - Add error reporting logic Error if false-negative version validation exist: e.g. find command fails to induce check_go_version - Add validation-failure reporting - Capture output of check_go_version for validation processing
  • make: Modify phrasing of error report to communicate violated version and stipulated version Remove exit status to be replaced with FAIL error-message presence

Tests

Tests to validate true positive and true negative

echo "Validate help print"
./tools/check-go-version-dockerfile.sh
./tools/check-go-version-yaml.sh
echo "Validate pass condition"
./tools/check-go-version-dockerfile.sh 1.21.4
./tools/check-go-version-yaml.sh 1.21.4
echo "Validate failure condition"
./tools/check-go-version-dockerfile.sh 96
./tools/check-go-version-yaml.sh 96

dstadulis avatar Feb 10 '24 23:02 dstadulis

As far as I'm aware, this PR isn't ready for me to review. So I'm going to remove my review request to keep my review request list short. Please re-request when ready.

ffranr avatar Apr 03 '24 22:04 ffranr

@jharveyb: review reminder

lightninglabs-deploy avatar May 30 '24 03:05 lightninglabs-deploy