diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d2b254b25c..158bb2ee22 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,7 +12,7 @@ repos: - id: buildifier-lint args: [--version, "v8.2.0", --warnings=all] - repo: https://github.com/crate-ci/typos - rev: v1.35.5 + rev: v1.38.1 hooks: - id: typos exclude: | @@ -22,17 +22,17 @@ repos: exclude_types: - diff - repo: https://github.com/psf/black - rev: 24.10.0 + rev: 25.9.0 hooks: - id: black - repo: https://github.com/PyCQA/isort - rev: 5.13.2 + rev: 7.0.0 hooks: - id: isort args: [--profile, black] - repo: https://github.com/pre-commit/mirrors-clang-format # See supported types: https://github.com/pre-commit/mirrors-clang-format/blob/v14.0.6/.pre-commit-hooks.yaml#L6 - rev: v14.0.6 + rev: v21.1.2 hooks: - id: clang-format exclude_types: diff --git a/crate_universe/defs.bzl b/crate_universe/defs.bzl index 2d5f219ebd..361dcc0605 100644 --- a/crate_universe/defs.bzl +++ b/crate_universe/defs.bzl @@ -99,7 +99,7 @@ rust_test( ### Direct Packages -In cases where Rust targets have heavy interractions with other Bazel targets ([Cc][cc], [Proto][proto], etc.), +In cases where Rust targets have heavy interactions with other Bazel targets ([Cc][cc], [Proto][proto], etc.), maintaining `Cargo.toml` files may have deminishing returns as things like [rust-analyzer][ra] begin to be confused about missing targets or environment variables defined only in Bazel. In workspaces like this, it may be desirable to have a "Cargo free" setup. `crates_repository` supports this through the `packages` attribute. diff --git a/crate_universe/private/crates_vendor.bzl b/crate_universe/private/crates_vendor.bzl index cf646eead3..ca18c11cd6 100644 --- a/crate_universe/private/crates_vendor.bzl +++ b/crate_universe/private/crates_vendor.bzl @@ -40,7 +40,7 @@ if [[ -n "${{CARGO_BAZEL_DEBUG:-}}" ]]; then fi # Pass on CARGO_REGISTRIES_* and CARGO_REGISTRY* -while IFS= read -r line; do _ENVIRON+=("${{line}}"); done < <(env | grep ^CARGO_REGISTR) +while IFS= read -r line; do _ENVIRON+=("${{line}}"); done < <(env | grep ^CARGO_REGISTER) # The path needs to be preserved to prevent bazel from starting with different # startup options (requiring a restart of bazel). @@ -65,7 +65,7 @@ SETLOCAL ENABLEDELAYEDEXPANSION @REM call :rlocation @REM The rlocation function maps the given to its absolute @REM path and stores the result in a variable named . -@REM This function fails if the doesn't exist in mainifest +@REM This function fails if the doesn't exist in manifest @REM file. :: Start of rlocation goto :rlocation_end diff --git a/crate_universe/private/generate_utils.bzl b/crate_universe/private/generate_utils.bzl index adb1f6f909..7a5d1a0513 100644 --- a/crate_universe/private/generate_utils.bzl +++ b/crate_universe/private/generate_utils.bzl @@ -362,7 +362,7 @@ def determine_repin( config, splicing_manifest, repin_instructions = None): - """Use the `cargo-bazel` binary to determine whether or not dpeendencies need to be re-pinned + """Use the `cargo-bazel` binary to determine whether or not dependencies need to be re-pinned Args: repository_ctx (repository_ctx): The rule's context object. diff --git a/examples/crate_universe/using_cxx/include/blobstore.h b/examples/crate_universe/using_cxx/include/blobstore.h index c1521e770c..8d0d922125 100644 --- a/examples/crate_universe/using_cxx/include/blobstore.h +++ b/examples/crate_universe/using_cxx/include/blobstore.h @@ -12,7 +12,7 @@ struct BlobMetadata; class BlobstoreClient { public: BlobstoreClient(); - uint64_t put(MultiBuf &buf) const; + uint64_t put(MultiBuf& buf) const; void tag(uint64_t blobid, rust::Str tag) const; BlobMetadata metadata(uint64_t blobid) const; diff --git a/examples/crate_universe/using_cxx/src/blobstore.cc b/examples/crate_universe/using_cxx/src/blobstore.cc index a63f129b2f..c881e529a8 100644 --- a/examples/crate_universe/using_cxx/src/blobstore.cc +++ b/examples/crate_universe/using_cxx/src/blobstore.cc @@ -27,7 +27,7 @@ class BlobstoreClient::impl { BlobstoreClient::BlobstoreClient() : impl(new class BlobstoreClient::impl) {} // Upload a new blob and return a blobid that serves as a handle to the blob. -uint64_t BlobstoreClient::put(MultiBuf &buf) const { +uint64_t BlobstoreClient::put(MultiBuf& buf) const { std::string contents; // Traverse the caller's chunk iterator. @@ -39,7 +39,7 @@ uint64_t BlobstoreClient::put(MultiBuf &buf) const { if (chunk.size() == 0) { break; } - contents.append(reinterpret_cast(chunk.data()), + contents.append(reinterpret_cast(chunk.data()), chunk.size()); } @@ -61,7 +61,7 @@ BlobMetadata BlobstoreClient::metadata(uint64_t blobid) const { if (blob != impl->blobs.end()) { metadata.size = blob->second.data.size(); std::for_each(blob->second.tags.cbegin(), blob->second.tags.cend(), - [&](auto &t) { metadata.tags.emplace_back(t); }); + [&](auto& t) { metadata.tags.emplace_back(t); }); } return metadata; } diff --git a/ffi/cc/allocator_library/allocator_library.cc b/ffi/cc/allocator_library/allocator_library.cc index 331c7587e9..a45c86d042 100644 --- a/ffi/cc/allocator_library/allocator_library.cc +++ b/ffi/cc/allocator_library/allocator_library.cc @@ -30,27 +30,27 @@ typedef __SIZE_TYPE__ uintptr_t; // New feature as of https://github.com/rust-lang/rust/pull/88098. __attribute__((weak)) uint8_t __rust_alloc_error_handler_should_panic = 0; -extern "C" uint8_t *__rdl_alloc(uintptr_t size, uintptr_t align); -extern "C" __attribute__((weak)) uint8_t *__rust_alloc(uintptr_t size, +extern "C" uint8_t* __rdl_alloc(uintptr_t size, uintptr_t align); +extern "C" __attribute__((weak)) uint8_t* __rust_alloc(uintptr_t size, uintptr_t align) { return __rdl_alloc(size, align); } -extern "C" void __rdl_dealloc(uint8_t *ptr, uintptr_t size, uintptr_t align); -extern "C" __attribute__((weak)) void __rust_dealloc(uint8_t *ptr, +extern "C" void __rdl_dealloc(uint8_t* ptr, uintptr_t size, uintptr_t align); +extern "C" __attribute__((weak)) void __rust_dealloc(uint8_t* ptr, uintptr_t size, uintptr_t align) { __rdl_dealloc(ptr, size, align); } -extern "C" uint8_t *__rdl_realloc(uint8_t *ptr, uintptr_t old_size, +extern "C" uint8_t* __rdl_realloc(uint8_t* ptr, uintptr_t old_size, uintptr_t align, uintptr_t new_size); -extern "C" __attribute__((weak)) uint8_t *__rust_realloc(uint8_t *ptr, +extern "C" __attribute__((weak)) uint8_t* __rust_realloc(uint8_t* ptr, uintptr_t old_size, uintptr_t align, uintptr_t new_size) { return __rdl_realloc(ptr, old_size, align, new_size); } -extern "C" uint8_t *__rdl_alloc_zeroed(uintptr_t size, uintptr_t align); -extern "C" __attribute__((weak)) uint8_t *__rust_alloc_zeroed(uintptr_t size, +extern "C" uint8_t* __rdl_alloc_zeroed(uintptr_t size, uintptr_t align); +extern "C" __attribute__((weak)) uint8_t* __rust_alloc_zeroed(uintptr_t size, uintptr_t align) { return __rdl_alloc_zeroed(size, align); } diff --git a/test/unit/build_script_deps/build_script_deps.bzl b/test/unit/build_script_deps/build_script_deps.bzl index 623200182e..2d79be4399 100644 --- a/test/unit/build_script_deps/build_script_deps.bzl +++ b/test/unit/build_script_deps/build_script_deps.bzl @@ -51,7 +51,7 @@ build_script_deps_test = analysistest.make( ) def build_script_test_suite(name): - """Build script analyisis tests. + """Build script analysis tests. Args: name: the test suite name diff --git a/test/unit/win_interface_library/bin.cc b/test/unit/win_interface_library/bin.cc index a3c073a5e7..23ad1b94b8 100644 --- a/test/unit/win_interface_library/bin.cc +++ b/test/unit/win_interface_library/bin.cc @@ -1,6 +1,6 @@ extern "C" void hello(void); -int main(int argc, char **argv) { +int main(int argc, char** argv) { hello(); return 0; }