From 1caced89a45b910b6eb6543eae29f535eeb73881 Mon Sep 17 00:00:00 2001 From: Alex Eagle Date: Wed, 3 Feb 2021 13:50:08 -0800 Subject: [PATCH] fix(docs): fix formatting of nodejs_binary#chdir --- docs/Built-ins.html | 56 ++++++++++++++++++++++-------------------- docs/Built-ins.md | 52 +++++++++++++++++++++------------------ internal/node/node.bzl | 30 +++++++++++----------- 3 files changed, 74 insertions(+), 64 deletions(-) diff --git a/docs/Built-ins.html b/docs/Built-ins.html index 1f05136c4f..ae44c754e7 100755 --- a/docs/Built-ins.html +++ b/docs/Built-ins.html @@ -415,26 +415,28 @@

name

chdir

(String): Working directory to run the binary or test in, relative to the workspace. - By default, Bazel always runs in the workspace root. - Due to implementation details, this argument must be underneath this package directory.

- -
    To run in the directory containing the `nodejs_binary` / `nodejs_test` use
-    `chdir = package_name()`
-    (or if you're in a macro, use `native.package_name()`)
-    
-    WARNING: this will affect other paths passed to the program, either as arguments or in configuration files,
-    which are workspace-relative.
-    You may need `../../` segments to re-relativize such paths to the new working directory.
+By default, Bazel always runs in the workspace root.
+Due to implementation details, this argument must be underneath this package directory.

+ +

To run in the directory containing the nodejs_binary / nodejs_test, use

+ +
chdir = package_name()
 
+

(or if you’re in a macro, use native.package_name())

+ +

WARNING: this will affect other paths passed to the program, either as arguments or in configuration files, +which are workspace-relative. +You may need ../../ segments to re-relativize such paths to the new working directory.

+

Defaults to ""

configuration_env_vars

(List of strings): Pass these configuration environment variables to the resulting binary. - Chooses a subset of the configuration environment variables (taken from ctx.var), which also - includes anything specified via the –define flag. - Note, this can lead to different outputs produced by this rule.

+Chooses a subset of the configuration environment variables (taken from ctx.var), which also +includes anything specified via the –define flag. +Note, this can lead to different outputs produced by this rule.

Defaults to []

@@ -647,26 +649,28 @@

name

chdir

(String): Working directory to run the binary or test in, relative to the workspace. - By default, Bazel always runs in the workspace root. - Due to implementation details, this argument must be underneath this package directory.

- -
    To run in the directory containing the `nodejs_binary` / `nodejs_test` use
-    `chdir = package_name()`
-    (or if you're in a macro, use `native.package_name()`)
-    
-    WARNING: this will affect other paths passed to the program, either as arguments or in configuration files,
-    which are workspace-relative.
-    You may need `../../` segments to re-relativize such paths to the new working directory.
+By default, Bazel always runs in the workspace root.
+Due to implementation details, this argument must be underneath this package directory.

+ +

To run in the directory containing the nodejs_binary / nodejs_test, use

+ +
chdir = package_name()
 
+

(or if you’re in a macro, use native.package_name())

+ +

WARNING: this will affect other paths passed to the program, either as arguments or in configuration files, +which are workspace-relative. +You may need ../../ segments to re-relativize such paths to the new working directory.

+

Defaults to ""

configuration_env_vars

(List of strings): Pass these configuration environment variables to the resulting binary. - Chooses a subset of the configuration environment variables (taken from ctx.var), which also - includes anything specified via the –define flag. - Note, this can lead to different outputs produced by this rule.

+Chooses a subset of the configuration environment variables (taken from ctx.var), which also +includes anything specified via the –define flag. +Note, this can lead to different outputs produced by this rule.

Defaults to []

diff --git a/docs/Built-ins.md b/docs/Built-ins.md index 86b5c1bab2..ac8cbbf47a 100755 --- a/docs/Built-ins.md +++ b/docs/Built-ins.md @@ -273,25 +273,27 @@ Runs some JavaScript code in NodeJS.

chdir

(*String*): Working directory to run the binary or test in, relative to the workspace. - By default, Bazel always runs in the workspace root. - Due to implementation details, this argument must be underneath this package directory. +By default, Bazel always runs in the workspace root. +Due to implementation details, this argument must be underneath this package directory. - To run in the directory containing the `nodejs_binary` / `nodejs_test` use - `chdir = package_name()` - (or if you're in a macro, use `native.package_name()`) - - WARNING: this will affect other paths passed to the program, either as arguments or in configuration files, - which are workspace-relative. - You may need `../../` segments to re-relativize such paths to the new working directory. +To run in the directory containing the `nodejs_binary` / `nodejs_test`, use + + chdir = package_name() + +(or if you're in a macro, use `native.package_name()`) + +WARNING: this will affect other paths passed to the program, either as arguments or in configuration files, +which are workspace-relative. +You may need `../../` segments to re-relativize such paths to the new working directory. Defaults to `""`

configuration_env_vars

(*List of strings*): Pass these configuration environment variables to the resulting binary. - Chooses a subset of the configuration environment variables (taken from `ctx.var`), which also - includes anything specified via the --define flag. - Note, this can lead to different outputs produced by this rule. +Chooses a subset of the configuration environment variables (taken from `ctx.var`), which also +includes anything specified via the --define flag. +Note, this can lead to different outputs produced by this rule. Defaults to `[]` @@ -513,25 +515,27 @@ remote debugger.

chdir

(*String*): Working directory to run the binary or test in, relative to the workspace. - By default, Bazel always runs in the workspace root. - Due to implementation details, this argument must be underneath this package directory. +By default, Bazel always runs in the workspace root. +Due to implementation details, this argument must be underneath this package directory. - To run in the directory containing the `nodejs_binary` / `nodejs_test` use - `chdir = package_name()` - (or if you're in a macro, use `native.package_name()`) - - WARNING: this will affect other paths passed to the program, either as arguments or in configuration files, - which are workspace-relative. - You may need `../../` segments to re-relativize such paths to the new working directory. +To run in the directory containing the `nodejs_binary` / `nodejs_test`, use + + chdir = package_name() + +(or if you're in a macro, use `native.package_name()`) + +WARNING: this will affect other paths passed to the program, either as arguments or in configuration files, +which are workspace-relative. +You may need `../../` segments to re-relativize such paths to the new working directory. Defaults to `""`

configuration_env_vars

(*List of strings*): Pass these configuration environment variables to the resulting binary. - Chooses a subset of the configuration environment variables (taken from `ctx.var`), which also - includes anything specified via the --define flag. - Note, this can lead to different outputs produced by this rule. +Chooses a subset of the configuration environment variables (taken from `ctx.var`), which also +includes anything specified via the --define flag. +Note, this can lead to different outputs produced by this rule. Defaults to `[]` diff --git a/internal/node/node.bzl b/internal/node/node.bzl index f3057f87a2..4a8d70a771 100644 --- a/internal/node/node.bzl +++ b/internal/node/node.bzl @@ -344,23 +344,25 @@ fi _NODEJS_EXECUTABLE_ATTRS = { "chdir": attr.string( doc = """Working directory to run the binary or test in, relative to the workspace. - By default, Bazel always runs in the workspace root. - Due to implementation details, this argument must be underneath this package directory. - - To run in the directory containing the `nodejs_binary` / `nodejs_test` use - `chdir = package_name()` - (or if you're in a macro, use `native.package_name()`) - - WARNING: this will affect other paths passed to the program, either as arguments or in configuration files, - which are workspace-relative. - You may need `../../` segments to re-relativize such paths to the new working directory. - """, +By default, Bazel always runs in the workspace root. +Due to implementation details, this argument must be underneath this package directory. + +To run in the directory containing the `nodejs_binary` / `nodejs_test`, use + + chdir = package_name() + +(or if you're in a macro, use `native.package_name()`) + +WARNING: this will affect other paths passed to the program, either as arguments or in configuration files, +which are workspace-relative. +You may need `../../` segments to re-relativize such paths to the new working directory. +""", ), "configuration_env_vars": attr.string_list( doc = """Pass these configuration environment variables to the resulting binary. - Chooses a subset of the configuration environment variables (taken from `ctx.var`), which also - includes anything specified via the --define flag. - Note, this can lead to different outputs produced by this rule.""", +Chooses a subset of the configuration environment variables (taken from `ctx.var`), which also +includes anything specified via the --define flag. +Note, this can lead to different outputs produced by this rule.""", default = [], ), "data": attr.label_list(