mintel / build-harness

🤖Collection of Makefiles to facilitate building Python/Golang projects, Dockerfiles, and more
Apache License 2.0
2 stars 6 forks source link

use recursive evaluation when finding isort and black #74

Closed aspage2 closed 1 year ago

aspage2 commented 1 year ago

if the DOCKER variable isn't defined at the point this Makefile is loaded, $(DOCKER) will evaluate to the empty string. "simple expansion", i.e. := in make, will eagerly evaluate the expression to the right, so it's possible for the ISORT/BLACK variables to be given malformed values (run --rm -it ..., missing the "docker" executable).

This change uses "recursive expansion", which delays expansion of variables until the target recipe is executed, giving DOCKER a chance to be populated.