Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vale #103

Merged
merged 18 commits into from
Feb 9, 2024
Merged

Vale #103

Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions example/.aspect/cli/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ lint:
- //tools:lint.bzl%flake8
- //tools:lint.bzl%pmd
- //tools:lint.bzl%ruff
- //tools:lint.bzl%vale
10 changes: 10 additions & 0 deletions example/.vale.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# NB: the value is replaced by an expand_template rule in BUILD.bazel
# since Vale can only read the path from this file, yet the location is determined by Bazel.
# See https://github.com/errata-ai/vale/issues/755
StylesPath = {StylesPath}

MinAlertLevel = warning
Packages = Google,write-good

[*]
BasedOnStyles = Vale,Google,write-good
12 changes: 12 additions & 0 deletions example/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template")
load("@aspect_rules_js//js:defs.bzl", "js_library")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
Expand All @@ -23,6 +24,17 @@ exports_files(
visibility = ["//visibility:public"],
)

# Workaround for https://github.com/errata-ai/vale/issues/755
expand_template(
name = "vale_ini",
data = ["//tools:vale_styles"],
substitutions = {
# Up three directory segments for bazel-out/arch/bin
"{StylesPath}": "../../../$(execpath //tools:vale_styles)",
},
template = ".vale.ini",
)

js_library(
name = "eslintrc",
srcs = [".eslintrc.cjs"],
Expand Down
Loading
Loading