Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a buildifier warning to enforce rule load location #1318

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

styurin
Copy link

@styurin styurin commented Dec 17, 2024

Addresses #1231, but without auto fixing.

@styurin styurin force-pushed the st/buildifier-rule-load-location branch from c1806b6 to 7f228ee Compare December 17, 2024 01:17
@styurin styurin marked this pull request as ready for review December 17, 2024 02:54
@styurin
Copy link
Author

styurin commented Jan 10, 2025

@vladmos could you take a look, please?

@vladmos
Copy link
Member

vladmos commented Jan 14, 2025

Is it actually recommended anywhere that genrule should be loaded from "//:genrule.bzl"? Imo it can be confusing for the users who have a different setup in their codebase.

Also, please fix the merge conflict.

@styurin styurin force-pushed the st/buildifier-rule-load-location branch from 6011c0b to 283c8f9 Compare January 15, 2025 21:36
@styurin
Copy link
Author

styurin commented Jan 15, 2025

Is it actually recommended anywhere that genrule should be loaded from "//:genrule.bzl"? Imo it can be confusing for the users who have a different setup in their codebase.

Updated to use "//tools/bazel:genrule.bzl" instead. This should promote better practices to structure folders with Bazel libraries.

@styurin
Copy link
Author

styurin commented Jan 30, 2025

@vladmos could you take another look, please?

@vladmos
Copy link
Member

vladmos commented Jan 31, 2025

I'm sorry, I still don't understand where the recommendation come from. If that's been discussed e.g. in a mailing list, could you please attach a link? I can imagine that some smaller projects have their own code structure and enforcing a fixed load location without apparent upsides can be noisy. Besides, isn't "genrule" a built-in function that doesn't need to be loaded at all?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants