Skip to content

Commit

Permalink
Fix CI errors (#47)
Browse files Browse the repository at this point in the history
* chore: update expand snapshot

by running `MACROTEST=overwrite cargo test`

* chore: add Node.js setup step in pull request workflow

* fix: correct formatting of JSDoc comments in type definitions
  • Loading branch information
todays-mitsui authored Nov 18, 2024
1 parent 694798e commit 9cb9563
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 36 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions tests-e2e/reference_output/test1/test1.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* tslint:disable */
/* eslint-disable */
/**
* @returns {Point}
*/
* @returns {Point}
*/
export function into_js(): Point;
export interface Point {
x: number;
Expand Down
4 changes: 2 additions & 2 deletions tests-e2e/reference_output/test2/test2.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* tslint:disable */
/* eslint-disable */
/**
* @returns {Point}
*/
* @returns {Point}
*/
export function into_js(): Point;
export interface Point {
x: number;
Expand Down
16 changes: 8 additions & 8 deletions tests-e2e/reference_output/test4/test4.d.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/* tslint:disable */
/* eslint-disable */
/**
* @param {Point} point
*/
* @param {Point} point
*/
export function consume(point: Point): void;
/**
* @returns {Point}
*/
* @returns {Point}
*/
export function into_js(): Point;
/**
* @param {(Point)[]} points
*/
* @param {(Point)[]} points
*/
export function consume_vector(points: (Point)[]): void;
/**
* @returns {(Point)[]}
*/
* @returns {(Point)[]}
*/
export function vector_into_js(): (Point)[];
export interface Point {
x: number;
Expand Down
12 changes: 6 additions & 6 deletions tests/expand/borrow.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ const _: () = {
Ok(js) => js.into_abi(),
Err(err) => {
let loc = core::panic::Location::caller();
let msg = {
let msg = ::alloc::__export::must_use({
let res = ::alloc::fmt::format(
format_args!(
"(Converting type failed) {0} ({1}:{2}:{3})", err, loc
.file(), loc.line(), loc.column(),
),
);
res
};
});
{
#[cold]
#[track_caller]
Expand Down Expand Up @@ -105,15 +105,15 @@ const _: () = {
Ok(js) => js.into(),
Err(err) => {
let loc = core::panic::Location::caller();
let msg = {
let msg = ::alloc::__export::must_use({
let res = ::alloc::fmt::format(
format_args!(
"(Converting type failed) {0} ({1}:{2}:{3})", err, loc
.file(), loc.line(), loc.column(),
),
);
res
};
});
{
#[cold]
#[track_caller]
Expand Down Expand Up @@ -145,15 +145,15 @@ const _: () = {
Ok(js) => js.into(),
Err(err) => {
let loc = core::panic::Location::caller();
let msg = {
let msg = ::alloc::__export::must_use({
let res = ::alloc::fmt::format(
format_args!(
"(Converting type failed) {0} ({1}:{2}:{3})", err, loc
.file(), loc.line(), loc.column(),
),
);
res
};
});
{
#[cold]
#[track_caller]
Expand Down
12 changes: 6 additions & 6 deletions tests/expand/generic_enum.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ const _: () = {
Ok(js) => js.into_abi(),
Err(err) => {
let loc = core::panic::Location::caller();
let msg = {
let msg = ::alloc::__export::must_use({
let res = ::alloc::fmt::format(
format_args!(
"(Converting type failed) {0} ({1}:{2}:{3})", err, loc
.file(), loc.line(), loc.column(),
),
);
res
};
});
{
#[cold]
#[track_caller]
Expand Down Expand Up @@ -106,15 +106,15 @@ const _: () = {
Ok(js) => js.into(),
Err(err) => {
let loc = core::panic::Location::caller();
let msg = {
let msg = ::alloc::__export::must_use({
let res = ::alloc::fmt::format(
format_args!(
"(Converting type failed) {0} ({1}:{2}:{3})", err, loc
.file(), loc.line(), loc.column(),
),
);
res
};
});
{
#[cold]
#[track_caller]
Expand Down Expand Up @@ -146,15 +146,15 @@ const _: () = {
Ok(js) => js.into(),
Err(err) => {
let loc = core::panic::Location::caller();
let msg = {
let msg = ::alloc::__export::must_use({
let res = ::alloc::fmt::format(
format_args!(
"(Converting type failed) {0} ({1}:{2}:{3})", err, loc
.file(), loc.line(), loc.column(),
),
);
res
};
});
{
#[cold]
#[track_caller]
Expand Down
24 changes: 12 additions & 12 deletions tests/expand/generic_struct.expanded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ const _: () = {
Ok(js) => js.into_abi(),
Err(err) => {
let loc = core::panic::Location::caller();
let msg = {
let msg = ::alloc::__export::must_use({
let res = ::alloc::fmt::format(
format_args!(
"(Converting type failed) {0} ({1}:{2}:{3})", err, loc
.file(), loc.line(), loc.column(),
),
);
res
};
});
{
#[cold]
#[track_caller]
Expand Down Expand Up @@ -103,15 +103,15 @@ const _: () = {
Ok(js) => js.into(),
Err(err) => {
let loc = core::panic::Location::caller();
let msg = {
let msg = ::alloc::__export::must_use({
let res = ::alloc::fmt::format(
format_args!(
"(Converting type failed) {0} ({1}:{2}:{3})", err, loc
.file(), loc.line(), loc.column(),
),
);
res
};
});
{
#[cold]
#[track_caller]
Expand Down Expand Up @@ -143,15 +143,15 @@ const _: () = {
Ok(js) => js.into(),
Err(err) => {
let loc = core::panic::Location::caller();
let msg = {
let msg = ::alloc::__export::must_use({
let res = ::alloc::fmt::format(
format_args!(
"(Converting type failed) {0} ({1}:{2}:{3})", err, loc
.file(), loc.line(), loc.column(),
),
);
res
};
});
{
#[cold]
#[track_caller]
Expand Down Expand Up @@ -295,15 +295,15 @@ const _: () = {
Ok(js) => js.into_abi(),
Err(err) => {
let loc = core::panic::Location::caller();
let msg = {
let msg = ::alloc::__export::must_use({
let res = ::alloc::fmt::format(
format_args!(
"(Converting type failed) {0} ({1}:{2}:{3})", err, loc
.file(), loc.line(), loc.column(),
),
);
res
};
});
{
#[cold]
#[track_caller]
Expand Down Expand Up @@ -342,15 +342,15 @@ const _: () = {
Ok(js) => js.into(),
Err(err) => {
let loc = core::panic::Location::caller();
let msg = {
let msg = ::alloc::__export::must_use({
let res = ::alloc::fmt::format(
format_args!(
"(Converting type failed) {0} ({1}:{2}:{3})", err, loc
.file(), loc.line(), loc.column(),
),
);
res
};
});
{
#[cold]
#[track_caller]
Expand Down Expand Up @@ -382,15 +382,15 @@ const _: () = {
Ok(js) => js.into(),
Err(err) => {
let loc = core::panic::Location::caller();
let msg = {
let msg = ::alloc::__export::must_use({
let res = ::alloc::fmt::format(
format_args!(
"(Converting type failed) {0} ({1}:{2}:{3})", err, loc
.file(), loc.line(), loc.column(),
),
);
res
};
});
{
#[cold]
#[track_caller]
Expand Down

0 comments on commit 9cb9563

Please sign in to comment.