Skip to content

Commit

Permalink
Add user.bazelrc support to each workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
UebelAndre committed Mar 1, 2022
1 parent adf2790 commit 8d9b4eb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
10 changes: 7 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# `.bazelrc` is a Bazel configuration file.
# https://docs.bazel.build/versions/master/best-practices.html#using-the-bazelrc-file
# https://bazel.build/docs/best-practices#bazelrc-file

# Enable rustfmt for all targets in the workspace
build:rustfmt --aspects=//rust:defs.bzl%rustfmt_aspect
Expand All @@ -9,5 +9,9 @@ build:rustfmt --output_groups=+rustfmt_checks
build:clippy --aspects=//rust:defs.bzl%rust_clippy_aspect
build:clippy --output_groups=+clippy_checks

# https://bazel.googlesource.com/bazel/+/master/site/docs/windows.md#enable-symlink-support
startup --windows_enable_symlinks
# https://bazel.build/docs/windows#symlink
startup --windows_enable_symlinks

# This import should always be last to allow users to override
# settings for local development.
try-import %workspace%/user.bazelrc
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/examples/bazel-*
/examples/crate_universe/*/bazel-*
/docs/bazel-*
user.bazelrc

# rustfmt
*.rs.bk
Expand Down
6 changes: 5 additions & 1 deletion examples/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# `.bazelrc` is a Bazel configuration file.
# https://docs.bazel.build/versions/master/best-practices.html#using-the-bazelrc-file
# https://bazel.build/docs/best-practices#bazelrc-file

# Enable rustfmt for all targets in the workspace
build:rustfmt --aspects=@rules_rust//rust:defs.bzl%rustfmt_aspect
Expand All @@ -8,3 +8,7 @@ build:rustfmt --output_groups=+rustfmt_checks
# Enable clippy for all targets in the workspace
build:clippy --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect
build:clippy --output_groups=+clippy_checks

# This import should always be last to allow users to override
# settings for local development.
try-import %workspace%/user.bazelrc
6 changes: 5 additions & 1 deletion examples/crate_universe/.bazelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# `.bazelrc` is a Bazel configuration file.
# https://docs.bazel.build/versions/master/best-practices.html#using-the-bazelrc-file
# https://bazel.build/docs/best-practices#bazelrc-file

# Enable rustfmt for all targets in the workspace
build:rustfmt --aspects=@rules_rust//rust:defs.bzl%rustfmt_aspect
Expand All @@ -8,3 +8,7 @@ build:rustfmt --output_groups=+rustfmt_checks
# Enable clippy for all targets in the workspace
build:clippy --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect
build:clippy --output_groups=+clippy_checks

# This import should always be last to allow users to override
# settings for local development.
try-import %workspace%/user.bazelrc

0 comments on commit 8d9b4eb

Please sign in to comment.