From bbddd752b075f69553e4f2ac3d5247e59ce681c0 Mon Sep 17 00:00:00 2001 From: solsjo Date: Tue, 30 Aug 2022 08:11:50 +0200 Subject: [PATCH] fix review comments --- .cirrus.yml | 4 ++-- latex.bzl | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index fc01f5b..021c004 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -2,7 +2,7 @@ container: image: l.gcr.io/google/bazel:latest task: name: Build the example document - build_script: bazel build //example/... --verbose_failures + build_script: bazel build //example:all task: name: Build all package tests - build_script: bazel build //packages:all --verbose_failures + build_script: bazel build //packages:all diff --git a/latex.bzl b/latex.bzl index c5482c3..4d4e811 100644 --- a/latex.bzl +++ b/latex.bzl @@ -9,7 +9,6 @@ def _latex_impl(ctx): custom_dependencies.append(file.dirname) custom_dependencies = ','.join(custom_dependencies) - ext =".{}".format(ctx.attr.format) flags = ["--flag=--latex-args=--output-format={}".format(ctx.attr.format)] for value in ctx.attr.cmd_flags: if "output-format" in value and ctx.attr.format not in value: @@ -30,7 +29,7 @@ def _latex_impl(ctx): "--flag=--latex-args=-shell-escape -jobname=" + ctx.label.name, "--flag=-Wall", "--input=" + ctx.file.main.path, - "--tool-output=" + ctx.file.main.basename.rsplit(".", 1)[0] + ext, + "--tool-output=" + ctx.file.main.basename.rsplit(".", 1)[0] + ".{}".format(ctx.attr.format), "--output=" + ctx.outputs.out.path, "--inputs=" + custom_dependencies, ] + flags, @@ -46,7 +45,7 @@ def _latex_impl(ctx): outputs = [ctx.outputs.out], tools = [ctx.executable._tool], ) - latex_info = LatexOutputInfo(file = ctx.outputs.out, format=ext) + latex_info = LatexOutputInfo(file = ctx.outputs.out, format=ctx.attr.format) return [latex_info] _latex = rule( @@ -63,7 +62,7 @@ _latex = rule( "format": attr.string( doc = "Output file format", default = "pdf", - values = ["dvi","pdf"], + values = ["dvi", "pdf"], ), "_tool": attr.label( default = Label("@bazel_latex//:tool_wrapper_py"),