[Tarantool-patches] [PATCH] tools: fix luacheck invocation in different cases
Alexander Turenko
alexander.turenko at tarantool.org
Thu Feb 18 19:11:08 MSK 2021
> On 01.12.2020 15:32, Alexander Turenko wrote:
> > Now `make luacheck` gracefully handles different cases: in-source and
> > out-of-source build (within the source tree or outside), current working
> > directory as a real path or with symlink components.
>
> 1. We already discussed it verbally and personally I don't like suggested
> solution with wrapper
>
> because it makes the code more complex.
>
> From side I have another solution that much more simple:
Out of source build would not work this way if the build directory is
outside of the source directory. I don't think that it is acceptable.
I'll rewrite my solution to CMake to don't spread logic across files.
<..stripped code and testing results..>
> > diff --git a/tools/run-luacheck.sh b/tools/run-luacheck.sh
> > new file mode 100755
> > index 000000000..e6ebb78b3
> > --- /dev/null
> > +++ b/tools/run-luacheck.sh
> > @@ -0,0 +1,71 @@
> > +#!/bin/sh
> > +
> > +set -eux
> > +
> > +SOURCE_DIR="${1:-}"
> > +BUILD_DIR="${2:-}"
>
> 2. I don't like such approach. I think wrapper should be transparent for
> user
>
> so that it allow to pass any luacheck option and it will be passed to a real
> luacheck.
>
> Otherwise you need to modify wrapper when you need to pass any other
> luacheck option.
It would be nice in theory, but it would require quite accurate handling
of paths that contain spaces. Likely IFS redefinition and so on. I would
not step into this until there will be a real need, but rather provide a
simple wrapper that works always.
Anyway, now everything in CMake (see patch v2).
More information about the Tarantool-patches
mailing list