diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 45ee9d40..472a856a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -195,6 +195,15 @@ jobs: uses: dtolnay/rust-toolchain@nightly if: matrix.config.variant == 'asan' + - name: check rust code formatting + run: cargo fmt --check + + - name: check c++ code formatting + if: startsWith(matrix.config.os, 'ubuntu') + run: | + sudo apt-get install -y clang-format + clang-format --Werror --dry-run src/binding.cc + - name: Test (ASAN) env: SCCACHE_IDLE_TIMEOUT: 0 @@ -220,9 +229,6 @@ jobs: ${{ matrix.config.cargo }} clippy --all-targets --locked ${{ env.CARGO_VARIANT_FLAG }} --target ${{ matrix.config.target }} -- -D clippy::all - - name: Rustfmt - run: cargo fmt -- --check - - name: Prepare binary publish if: matrix.config.variant == 'debug' || matrix.config.variant == 'release' run: gzip -9c diff --git a/src/binding.cc b/src/binding.cc index 88ff98ac..6a702a9d 100644 --- a/src/binding.cc +++ b/src/binding.cc @@ -1200,12 +1200,12 @@ void v8__Template__Set(const v8::Template& self, const v8::Name& key, ptr_to_local(&self)->Set(ptr_to_local(&key), ptr_to_local(&value), attr); } -void v8__Template__SetIntrinsicDataProperty( - const v8::Template& self, const v8::Name& key, - v8::Intrinsic intrinsic, - v8::PropertyAttribute attr) { - ptr_to_local(&self)->SetIntrinsicDataProperty(ptr_to_local(&key), - intrinsic, attr); +void v8__Template__SetIntrinsicDataProperty(const v8::Template& self, + const v8::Name& key, + v8::Intrinsic intrinsic, + v8::PropertyAttribute attr) { + ptr_to_local(&self)->SetIntrinsicDataProperty(ptr_to_local(&key), intrinsic, + attr); } const v8::ObjectTemplate* v8__ObjectTemplate__New( @@ -1810,10 +1810,8 @@ size_t v8__ArrayBuffer__ByteLength(const v8::ArrayBuffer& self) { return self.ByteLength(); } -const v8::DataView* v8__DataView__New( - const v8::ArrayBuffer& ab, - size_t offset, - size_t length) { +const v8::DataView* v8__DataView__New(const v8::ArrayBuffer& ab, size_t offset, + size_t length) { return local_to_ptr(v8::DataView::New(ptr_to_local(&ab), offset, length)); }