Skip to content

Add buildifier lint action - #2243

Merged
GMNGeoffrey merged 6 commits into
iree-org:mainfrom
GMNGeoffrey:buildifier
Jul 13, 2020
Merged

GMNGeoffrey merged 6 commits into
iree-org:mainfrom
GMNGeoffrey:buildifier

Conversation

@GMNGeoffrey

@GMNGeoffrey GMNGeoffrey commented Jun 18, 2020 •

Copy link
Copy Markdown
Member

This should reduce errors we only see on import into Google's source repository, where buildifier formatting is enforced.

Includes reformatting the WORKSPACE file, since that wasn't formatted previously (and WORKSPACE files are not checked internally) and marking the source list as not sortable in embed_data/BUILD which is already excluded from sorting internally. Depends on #2488 which removes usage of native py_binary, that I think would break things in open source anyway. Since that's actually a behavior change, split it into a separate PR.

@GMNGeoffrey
GMNGeoffrey requested a review from ScottTodd June 18, 2020 01:15
@GMNGeoffrey
GMNGeoffrey marked this pull request as ready for review June 18, 2020 01:15

@ScottTodd ScottTodd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm skeptical about this taking 0 seconds to run if it isn't filtering to only changed files: https://github.com/google/iree/pull/2243/checks?check_run_id=782661412 .

Have you tested with errors that buildifier reports?

Comment thread .github/workflows/buildifier.yml Resolved
@GMNGeoffrey

Copy link
Copy Markdown
Member Author

I'm skeptical about this taking 0 seconds to run if it isn't filtering to only changed files: https://github.com/google/iree/pull/2243/checks?check_run_id=782661412 .

Have you tested with errors that buildifier reports?

You know, probably checking out the repository first would help a lot.... 🤦

@GMNGeoffrey
GMNGeoffrey changed the base branch from master to google June 23, 2020 17:36
@GMNGeoffrey
GMNGeoffrey force-pushed the buildifier branch 2 times, most recently from adac7eb to 0b1bd61 Compare June 24, 2020 23:31
@GMNGeoffrey

Copy link
Copy Markdown
Member Author

Whelp finally got it to run, but there are a lot of warnings...

@benvanik

Copy link
Copy Markdown
Collaborator

This is exciting!

One thing that would be nice to do as a cleanup is move all the linty things into the same workflow - then we wouldn't have 4 of them with redundant names at the top level and only see the failures that matter.

@GMNGeoffrey

Copy link
Copy Markdown
Member Author

This is exciting!

Now I just have to fix those thousand lint warnings :-D

One thing that would be nice to do as a cleanup is move all the linty things into the same workflow - then we wouldn't have 4 of them with redundant names at the top level and only see the failures that matter.

Same workflow or same job? That is, are you complaining about extra status markers on PRs or about extra files in the directory?

@benvanik

Copy link
Copy Markdown
Collaborator

These specifically:
image

If there was one "Format/Lint" workflow with buildifier/bazel-to-cmake/submodules/clang-format/clang-tidy/python linting/etc as steps then there's a nice hierarchy (like
image)

This then shows as a nice grouping in the actions status page:
image

as opposed to our current one, which needs a bunch of clicky clicks:
image

@GMNGeoffrey

Copy link
Copy Markdown
Member Author

Ah got it. Yeah I think that would be accomplished by making these separate jobs in the same file.

@GMNGeoffrey

Copy link
Copy Markdown
Member Author

Since it's going to take a bit to clean up the buildifier check, I'm doing the reorganization as a separate PR. #2314

GMNGeoffrey added a commit that referenced this pull request Jun 25, 2020
Per discussion on #2243, this will provide better-organized status check notations on PRs.

Also drops redundant `name` field for the jobs in favor of the yaml name.

While I was here, I made the bazel_to_cmake diff check a separate step from running the tool. This makes it easier to see the diff in the logs since the tool prints out a bunch of logs.

This is deliberately a pull request against `main` instead of `google` as part of testing out the new flow (#2279).
@GMNGeoffrey
GMNGeoffrey changed the base branch from google to main June 26, 2020 21:15
@GMNGeoffrey
GMNGeoffrey force-pushed the buildifier branch 2 times, most recently from dd9fa26 to c934eaa Compare July 11, 2020 22:58
@GMNGeoffrey GMNGeoffrey changed the title Add buildifier check Add buildifier lint action Jul 11, 2020
@GMNGeoffrey
GMNGeoffrey requested a review from ScottTodd July 11, 2020 23:08
@GMNGeoffrey
GMNGeoffrey merged commit 645a88b into iree-org:main Jul 13, 2020
@GMNGeoffrey
GMNGeoffrey deleted the buildifier branch July 13, 2020 16:41
This was referenced Jul 13, 2020
copybara-service Bot pushed a commit that referenced this pull request Jul 14, 2020
* f4f2fec Update Bazel version in docs workflow (#2511)
* 19e6574 Add lint action for PR title length (#2481)
* 57a9ae3 Moved CompiledModule and BackendInfo to `tf_utils.py` (#2509)
* 7d50357 Update Bazel to 3.3.1 (#2496)
* afa7d8e [ModelBuilder] Fix leak when using llvm::createLowerMatrixIntrinsicsPass (#2499)
* 90ffb71 [ci] Enable build tests for Android cross compilation (#2507)
* 62490cb Add Bazel 3.3.1 to docker images (#2497)
* 028a883 [ci] Run cmake --build twice to temporary fix the flaky build (#2501)
* 8096658 Start creating $async functions as part of public ABI generation. (#2411)
* 27a1f3d Removed gather lowering test (#2503)
* 02cc1e3 Merge google -> main (#2505)
* 6706f3d Add GitHub action to create PRs merging google -> main (#2482)
* 645a88b Add buildifier lint action (#2243)
* fc812fe Support iree-run-mlir to read input values from a file. (#2352)
* 8078fc6 Use iree_py_binary in keras test binaries (#2488)
* 9f22404 Treat warnings as errors and silence them in third party code (#2489)
* cb000c7 Avoid unused result warning (#2469)
* b06a482 Fix some minor typos (#2486)
* ce6c171 Create cooperative matrix performance test (#2443)
* 0880ee9 Add android build badge to README (#2473)
* 8e14d1f [vulkan] Guard against 0-byte buffer allocation (#2467)
* ef019df Improve TF submodule bump action descriptions (#2471)
* c53ad00 Refactors tf_test_utils, creating tf_utils and simplifying module specificatio..
* a90df48 Merge google -> main (#2468)

PiperOrigin-RevId: 321174064
@copybara-service copybara-service Bot mentioned this pull request Jul 14, 2020
@GMNGeoffrey GMNGeoffrey added the infrastructure Relating to build systems, CI, or testing label Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure Relating to build systems, CI, or testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants