Skip to content

Commit f624cba

Browse files
authored
[Checkstyle] use better internal names (#342)
WIth the addition of #283, the checkstyle execution script added two internal names. The problem is either overlap with the config file name, the checkstyle fails with a stack trace. Use a name for these internal temp files less likely to collide (and error) with the user supplied config files. This fixes #311.
1 parent e153df2 commit f624cba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

java/private/checkstyle.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,16 @@ def _checkstyle_impl(ctx):
1919
"set +e",
2020
"OLDPWD=$PWD",
2121
] + maybe_cd_config_dir + [
22-
"$OLDPWD/{lib} -o checkstyle.xml -f xml -c {config} {srcs}".format(
22+
"$OLDPWD/{lib} -o _checkstyle_raw.xml -f xml -c {config} {srcs}".format(
2323
lib = info.checkstyle.short_path,
2424
config = config.basename,
2525
srcs = " ".join(["$OLDPWD/" + f.short_path for f in ctx.files.srcs]),
2626
),
2727
"checkstyle_exit_code=$?",
2828
# Apply sed to the file in place
29-
"sed s:$OLDPWD/::g checkstyle.xml > checkstyle-stripped.xml",
29+
"sed s:$OLDPWD/::g _checkstyle_raw.xml > _checkstyle_stripped.xml",
3030
# Run the Java XSLT transformation tool
31-
"$OLDPWD/{xslt_transformer} checkstyle-stripped.xml $OLDPWD/{xslt} > $XML_OUTPUT_FILE".format(
31+
"$OLDPWD/{xslt_transformer} _checkstyle_stripped.xml $OLDPWD/{xslt} > $XML_OUTPUT_FILE".format(
3232
xslt_transformer = ctx.executable._xslt_transformer.short_path,
3333
xslt = ctx.file.xslt.short_path,
3434
),

0 commit comments

Comments
 (0)