Skip to content

Commit 6c999c6

Browse files
authored
Update instructions to sync TF compat protos (#6916)
I've ran into linter / formatting issues the last couple of times I've ran the proto sync script, so this is expanding the instructions to run the `buildifier` tool after the proto sync is made.
1 parent 501cda8 commit 6c999c6

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

tensorboard/compat/proto/proto_test.py

+32-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,38 @@
222222
223223
bazel run //tensorboard/data/server:update_protos
224224
225-
6. Review and commit any changes.
225+
6. The source file from TF seems to have a formatting that differs from the one
226+
we use on our repo, so you might need to reformat the BUILD file.
227+
The instructions below reproduce the check our CI workflow does, for
228+
convenience, but they might need to be updated if this process is updated
229+
in our CI workflow.
230+
231+
To reformat the file the way our lint will check, you'll need to copy the
232+
values for the `BUILDTOOLS_VERSION` and `BUILDIFIER_SHA256SUM` from our CI
233+
workflow, and then download the buildifier binary to a local directory,
234+
e.g. `~/tb_buildifier/buildifier`:
235+
236+
```
237+
$ BUILDTOOLS_VERSION='3.0.0'
238+
$ BUILDIFIER_SHA256SUM='e92a6793c7134c5431c58fbc34700664f101e5c9b1c1fcd93b97978e8b7f88db'
239+
$ ci/download_buildifier.sh "${BUILDTOOLS_VERSION}" "${BUILDIFIER_SHA256SUM}" ~/tb_buildifier/buildifier
240+
```
241+
242+
If a file needs reformatting, you'll see the file that needs to be
243+
reformatted as the output of this command (the same one that is run by CI
244+
workflow):
245+
246+
```
247+
$ git ls-files -z '*BUILD' third_party/js.bzl third_party/workspace.bzl WORKSPACE | xargs -0 ~/tb_buildifier/buildifier --mode=check --lint=warn --warnings=-native-py,-native-java
248+
```
249+
250+
To reformat, execute the command without the "mode" and "lint" parameters:
251+
252+
```
253+
$ git ls-files -z '*BUILD' third_party/js.bzl third_party/workspace.bzl WORKSPACE | xargs -0 ~/tb_buildifier/buildifier
254+
```
255+
256+
7. Review and commit any changes.
226257
227258
"""
228259

0 commit comments

Comments
 (0)