Skip to content

Commit

Permalink
Switch to Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperisager committed Nov 26, 2024
1 parent e27e4b5 commit b2b959d
Show file tree
Hide file tree
Showing 9 changed files with 149 additions and 148 deletions.
4 changes: 0 additions & 4 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,3 @@ BinPackParameters: false
ContinuationIndentWidth: 2
ColumnLimit: 0
SpaceAfterCStyleCast: true
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterFunctionDeclarationName: true
AfterFunctionDefinitionName: true
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
128 changes: 64 additions & 64 deletions .github/workflows/prebuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,74 +6,74 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-22.04
platform: linux
arch: x64
- os: ubuntu-22.04-arm64
platform: linux
arch: arm64
- os: ubuntu-22.04
platform: android
arch: x64
- os: ubuntu-22.04
platform: android
arch: ia32
- os: ubuntu-22.04
platform: android
arch: arm64
- os: ubuntu-22.04
platform: android
arch: arm
- os: macos-14
platform: darwin
arch: x64
- os: macos-14
platform: darwin
arch: arm64
- os: macos-14
platform: ios
arch: arm64
- os: macos-14
platform: ios
arch: arm64
tags: -simulator
flags: --simulator
- os: macos-14
platform: ios
arch: x64
tags: -simulator
flags: --simulator
- os: windows-2022
platform: win32
arch: x64
- os: windows-2022
platform: win32
arch: arm64
- os: ubuntu-22.04
platform: linux
arch: x64
- os: ubuntu-22.04-arm64
platform: linux
arch: arm64
- os: ubuntu-22.04
platform: android
arch: x64
- os: ubuntu-22.04
platform: android
arch: ia32
- os: ubuntu-22.04
platform: android
arch: arm64
- os: ubuntu-22.04
platform: android
arch: arm
- os: macos-14
platform: darwin
arch: x64
- os: macos-14
platform: darwin
arch: arm64
- os: macos-14
platform: ios
arch: arm64
- os: macos-14
platform: ios
arch: arm64
tags: -simulator
flags: --simulator
- os: macos-14
platform: ios
arch: x64
tags: -simulator
flags: --simulator
- os: windows-2022
platform: win32
arch: x64
- os: windows-2022
platform: win32
arch: arm64
runs-on: ${{ matrix.os }}
name: ${{ matrix.platform }}-${{ matrix.arch }}${{ matrix.tags }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: npm install -g bare-runtime bare-make
- run: npm install
- run: bare-make generate --platform ${{ matrix.platform }} --arch ${{ matrix.arch }} ${{ matrix.flags }}
- run: bare-make build
- run: bare-make install
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-${{ matrix.arch }}${{ matrix.tags }}
path: prebuilds/*
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: npm install -g bare-runtime bare-make
- run: npm install
- run: bare-make generate --platform ${{ matrix.platform }} --arch ${{ matrix.arch }} ${{ matrix.flags }}
- run: bare-make build
- run: bare-make install
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform }}-${{ matrix.arch }}${{ matrix.tags }}
path: prebuilds/*
merge:
runs-on: ubuntu-latest
needs: prebuild
steps:
- uses: actions/download-artifact@v4
with:
path: prebuilds
merge-multiple: true
- uses: actions/upload-artifact@v4
with:
name: prebuilds
path: prebuilds
- uses: actions/download-artifact@v4
with:
path: prebuilds
merge-multiple: true
- uses: actions/upload-artifact@v4
with:
name: prebuilds
path: prebuilds
38 changes: 19 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-latest
platform: linux
arch: x64
- os: macos-latest
platform: darwin
arch: arm64
- os: windows-latest
platform: win32
arch: x64
- os: ubuntu-latest
platform: linux
arch: x64
- os: macos-latest
platform: darwin
arch: arm64
- os: windows-latest
platform: win32
arch: x64
runs-on: ${{ matrix.os }}
name: ${{ matrix.platform }}-${{ matrix.arch }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: npm install -g bare-runtime bare-make
- run: npm install
- run: bare-make generate --platform ${{ matrix.platform }} --arch ${{ matrix.arch }} --debug
- run: bare-make build
- run: bare-make install
- run: npm test
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- run: npm install -g bare-runtime bare-make
- run: npm install
- run: bare-make generate --platform ${{ matrix.platform }} --arch ${{ matrix.arch }} --debug
- run: bare-make build
- run: bare-make install
- run: npm test
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"prettier-config-standard"
26 changes: 13 additions & 13 deletions binding.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ typedef struct {
} bare_tty_t;

static void
bare_tty__on_write (uv_write_t *req, int status) {
bare_tty__on_write(uv_write_t *req, int status) {
int err;

bare_tty_t *tty = (bare_tty_t *) req->data;
Expand Down Expand Up @@ -66,7 +66,7 @@ bare_tty__on_write (uv_write_t *req, int status) {
}

static void
bare_tty__on_read (uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf) {
bare_tty__on_read(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf) {
if (nread == UV_EOF) nread = 0;
else if (nread == 0) return;

Expand Down Expand Up @@ -119,7 +119,7 @@ bare_tty__on_read (uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf) {
}

static void
bare_tty__on_close (uv_handle_t *handle) {
bare_tty__on_close(uv_handle_t *handle) {
int err;

bare_tty_t *tty = (bare_tty_t *) handle;
Expand Down Expand Up @@ -157,14 +157,14 @@ bare_tty__on_close (uv_handle_t *handle) {
}

static void
bare_tty__on_alloc (uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf) {
bare_tty__on_alloc(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf) {
bare_tty_t *tty = (bare_tty_t *) handle;

*buf = tty->read;
}

static js_value_t *
bare_tty_init (js_env_t *env, js_callback_info_t *info) {
bare_tty_init(js_env_t *env, js_callback_info_t *info) {
int err;

size_t argc = 6;
Expand Down Expand Up @@ -221,7 +221,7 @@ bare_tty_init (js_env_t *env, js_callback_info_t *info) {
}

static js_value_t *
bare_tty_writev (js_env_t *env, js_callback_info_t *info) {
bare_tty_writev(js_env_t *env, js_callback_info_t *info) {
int err;

size_t argc = 2;
Expand Down Expand Up @@ -271,7 +271,7 @@ bare_tty_writev (js_env_t *env, js_callback_info_t *info) {
}

static js_value_t *
bare_tty_resume (js_env_t *env, js_callback_info_t *info) {
bare_tty_resume(js_env_t *env, js_callback_info_t *info) {
int err;

size_t argc = 1;
Expand All @@ -297,7 +297,7 @@ bare_tty_resume (js_env_t *env, js_callback_info_t *info) {
}

static js_value_t *
bare_tty_pause (js_env_t *env, js_callback_info_t *info) {
bare_tty_pause(js_env_t *env, js_callback_info_t *info) {
int err;

size_t argc = 1;
Expand All @@ -323,7 +323,7 @@ bare_tty_pause (js_env_t *env, js_callback_info_t *info) {
}

static js_value_t *
bare_tty_close (js_env_t *env, js_callback_info_t *info) {
bare_tty_close(js_env_t *env, js_callback_info_t *info) {
int err;

size_t argc = 1;
Expand All @@ -350,7 +350,7 @@ bare_tty_close (js_env_t *env, js_callback_info_t *info) {
}

static js_value_t *
bare_tty_set_mode (js_env_t *env, js_callback_info_t *info) {
bare_tty_set_mode(js_env_t *env, js_callback_info_t *info) {
int err;

size_t argc = 2;
Expand Down Expand Up @@ -380,7 +380,7 @@ bare_tty_set_mode (js_env_t *env, js_callback_info_t *info) {
}

static js_value_t *
bare_tty_get_window_size (js_env_t *env, js_callback_info_t *info) {
bare_tty_get_window_size(js_env_t *env, js_callback_info_t *info) {
int err;

size_t argc = 1;
Expand Down Expand Up @@ -425,7 +425,7 @@ bare_tty_get_window_size (js_env_t *env, js_callback_info_t *info) {
}

static js_value_t *
bare_tty_is_tty (js_env_t *env, js_callback_info_t *info) {
bare_tty_is_tty(js_env_t *env, js_callback_info_t *info) {
int err;

size_t argc = 1;
Expand All @@ -448,7 +448,7 @@ bare_tty_is_tty (js_env_t *env, js_callback_info_t *info) {
}

static js_value_t *
bare_tty_exports (js_env_t *env, js_value_t *exports) {
bare_tty_exports(js_env_t *env, js_value_t *exports) {
int err;

#define V(name, fn) \
Expand Down
Loading

0 comments on commit b2b959d

Please sign in to comment.