Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed Jul 16, 2024
1 parent 1bec66c commit ee102e2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion example/test/lint_test.bats
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ EOF
assert_output --partial 'src/file.proto:1:1:Import "src/unused.proto" is unused.'

# Vale
assert_output --partial "src/README.md:3:47:Google.We:Try to avoid using first-person plural like 'We'."
echo <<"EOF" | assert_output --partial
3:47 warning Try to avoid using Google.We
first-person plural like 'We'.
EOF
}

@test "should produce reports" {
Expand Down
2 changes: 1 addition & 1 deletion lint/shellcheck.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def _shellcheck_aspect_impl(target, ctx):
else:
# shellcheck does not have a --fix mode that applies fixes for some violations while reporting others.
# So we must run a second action to populate the human-readable report.
shellcheck_action(ctx, ctx.executable._shellcheck, files_to_lint, ctx.file._config_file, stdout, exit_code, options = ["--color"])
shellcheck_action(ctx, ctx.executable._shellcheck, files_to_lint, ctx.file._config_file, stdout, exit_code)

if report:
shellcheck_action(ctx, ctx.executable._shellcheck, files_to_lint, ctx.file._config_file, report, exit_code = "discard")
Expand Down
4 changes: 3 additions & 1 deletion lint/vale.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ def vale_action(ctx, executable, srcs, styles, config, stdout, exit_code = None,
format: the value for the --output CLI flag
"""
inputs = srcs + [config]
env = {}

# TODO(#332): enable color when requested
env = {"NO_COLOR": "1"}
if styles:
inputs.append(styles)

Expand Down

0 comments on commit ee102e2

Please sign in to comment.