dwtj / dwtj_rules_markdown Goto Github PK
View Code? Open in Web Editor NEWLint Markdown files in your Bazel workspace
Home Page: https://dwtj.github.io/dwtj_rules_markdown/
License: MIT License
Lint Markdown files in your Bazel workspace
Home Page: https://dwtj.github.io/dwtj_rules_markdown/
License: MIT License
Currently, the README.md
suggests synthesizing a markdownlint toolchain like this:
local_markdownlint_external_repository(
name = 'local_markdownlint',
)
I haven't tested it yet, but from looking at the code, I suspect that it will fail ungracefully if the user sets any name
besides local_markdownlint
. At least one problem would come from here
because it uses a hard-coded local_markdownlint
.
I think that this issue should be resolved in one of two ways:
name
attribute.I tried this:
load("@dwtj_rules_markdown//markdown:toolchains.bzl", "markdownlint_toolchain")
markdownlint_toolchain(
name = "mdlint_toolchain_instance",
node_executable = "@nodejs//:node",
markdownlint_executable = "@npm//markdownlint-cli/bin:markdownlint.sh",
config = "//:.markdownlint.json",
)
toolchain(
name = "mdlint_toolchain",
toolchain = ":mdlint_toolchain_instance",
toolchain_type = "@dwtj_rules_markdown//markdown/toolchains/markdownlint:toolchain_type",
visibility = ["//visibility:public"],
)
But it seems that what is passed to markdownlint_executable
is passed as an argument to the node_executable
, which seems weird, it is executable on its own. (I can pass the markdownlint.js file, and that runs, but then it can't find its dependencies)
The project README currently recommends that a client Bazel project should add something like this to their WORKSPACE
file:
DWTJ_RULES_MARKDOWN_COMMIT = "c555fe9dca1782c123ec8eda1fdba11345e9e5e7"
DWTJ_RULES_MARKDOWN_SHA256 = "f5ed694d7a3998e68f2d3648263e59d8dfd5a815f985909c343a94f6c534ed10"
http_archive(
name = "dwtj_rules_markdown",
sha256 = DWTJ_RULES_MARKDOWN_SHA256,
strip_prefix = "dwtj_rules_markdown-{}".format(DWTJ_RULES_MARKDOWN_COMMIT),
url = "https://github.com/dwtj/dwtj_rules_markdown/archive/{}.zip".format(DWTJ_RULES_MARKDOWN_COMMIT),
)
load("@dwtj_rules_markdown//markdown:defs.bzl", "local_markdownlint_external_repository")
local_markdownlint_external_repository(
name = 'local_markdownlint',
)
load('@local_markdownlint//:defs.bzl', 'register_local_markdownlint_toolchain')
register_local_markdownlint_toolchain()
However, builds with such a WORKSPACE currently fail because of a bug:
ERROR: /home/dwtj/Projects/PhasicJ/BUILD:3:17: //:markdown: missing input file 'external/local_markdownlint/markdownlint_config.json', owner: '@local_markdownlint//:markdownlint_config.json'
ERROR: /home/dwtj/Projects/PhasicJ/BUILD:3:17 1 input file(s) do not exist
As a workaround, the user can specify a config file explicitly. For example,
local_markdownlint_external_repository(
name = 'local_markdownlint',
config = '//:.markdownlint.json'
)
The readme says
build --aspects @dwtj_rules_markdown//markdown:aspects.bzl%markdownlint_aspect
but the example shows it has to be
build --aspects @dwtj_rules_markdown//markdown:defs.bzl%markdownlint_aspect
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.