{"action":"created","issue":{"url":"https://api.github.com/repos/atlassian/bazel-tools/issues/2","repository_url":"https://api.github.com/repos/atlassian/bazel-tools","labels_url":"https://api.github.com/repos/atlassian/bazel-tools/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/atlassian/bazel-tools/issues/2/comments","events_url":"https://api.github.com/repos/atlassian/bazel-tools/issues/2/events","html_url":"https://github.com/atlassian/bazel-tools/issues/2","id":334279870,"node_id":"MDU6SXNzdWUzMzQyNzk4NzA=","number":2,"title":"Support running without command file","user":{"login":"negz","id":1049349,"node_id":"MDQ6VXNlcjEwNDkzNDk=","avatar_url":"https://avatars2.githubusercontent.com/u/1049349?v=4","gravatar_id":"","url":"https://api.github.com/users/negz","html_url":"https://github.com/negz","followers_url":"https://api.github.com/users/negz/followers","following_url":"https://api.github.com/users/negz/following{/other_user}","gists_url":"https://api.github.com/users/negz/gists{/gist_id}","starred_url":"https://api.github.com/users/negz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/negz/subscriptions","organizations_url":"https://api.github.com/users/negz/orgs","repos_url":"https://api.github.com/users/negz/repos","events_url":"https://api.github.com/users/negz/events{/privacy}","received_events_url":"https://api.github.com/users/negz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-20T23:06:02Z","updated_at":"2018-06-21T23:18:03Z","closed_at":null,"author_association":"NONE","body":"Hello,\r\n\r\nI'd like to use this convenience buildozer rule, but wish it were a little less opinionated. Currently it seems to require Buildozer commands be fed in via a file while I would prefer to pass them in as an argument, for example `bazel run //:buildozer -- somecommand`.\r\n\r\nThe context here is that for historical reasons my Bazel monorepo has a lot of Go vendor directories. We're also using an older Go vendoring tool that helpfully generates `go_test` rules for said vendor directories. This means our BUILD file generation strategy looks something like:\r\n\r\n```bash\r\n$ bazel run //:gazelle -- fix services/myservice\r\n$ buildozer delete //services/myservice/vendor/...:%go_test\r\n```\r\n\r\nI'm not a Bazel expert and could be wrong, but I don't believe there's any way to specify a label like `//.../vendor/...:%go_test` - if there were I'd be happy to throw such a command in `//:buildozer_commands.txt` and stick with the existing pattern."},"comment":{"url":"https://api.github.com/repos/atlassian/bazel-tools/issues/comments/399272705","html_url":"https://github.com/atlassian/bazel-tools/issues/2#issuecomment-399272705","issue_url":"https://api.github.com/repos/atlassian/bazel-tools/issues/2","id":399272705,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTI3MjcwNQ==","user":{"login":"ash2k","id":126021,"node_id":"MDQ6VXNlcjEyNjAyMQ==","avatar_url":"https://avatars3.githubusercontent.com/u/126021?v=4","gravatar_id":"","url":"https://api.github.com/users/ash2k","html_url":"https://github.com/ash2k","followers_url":"https://api.github.com/users/ash2k/followers","following_url":"https://api.github.com/users/ash2k/following{/other_user}","gists_url":"https://api.github.com/users/ash2k/gists{/gist_id}","starred_url":"https://api.github.com/users/ash2k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ash2k/subscriptions","organizations_url":"https://api.github.com/users/ash2k/orgs","repos_url":"https://api.github.com/users/ash2k/repos","events_url":"https://api.github.com/users/ash2k/events{/privacy}","received_events_url":"https://api.github.com/users/ash2k/received_events","type":"User","site_admin":false},"created_at":"2018-06-21T23:18:03Z","updated_at":"2018-06-21T23:18:03Z","author_association":"MEMBER","body":"Ok, I understand your use case now, thank you. Feel free to submit a PR (don't forget to sign the CLA).\r\nHowever, if I were you, I'd instead do these two things:\r\n- Open an issue (or a PR) with buildozer to add support for label wildcards like what you need `//.../vendor/...:%go_test`\r\n- Instead of recommending engineers to run `buildozer delete //services/myservice/vendor/...:%go_test` add a bazel target that generates the commands file with directories that you want fixed. Use something like `find . -type d -name vendor` in the script. And then have the buildozer rule depend on that generated commands file. That way your engineers would not need to maintain that pattern per service and only run `bazel run //:buildozer` to fix all vendor folders. This may require some experimentation with `glob()` to declare dependencies of that generator rule... I'm not 100% it will work nicely, but worth a try."}}
{"actor":{"display_login":"ash2k"}}