Skip to content

Commit f223bdf

Browse files
committed
format profiling with biome
1 parent a5dff2d commit f223bdf

24 files changed

+307
-314
lines changed

packages/profiling-node/.eslintrc.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@ module.exports = {
44
},
55
extends: ['../../.eslintrc.js'],
66

7-
ignorePatterns: [
8-
'lib/**/*',
9-
'examples/**/*',
10-
'jest.co'
11-
],
7+
ignorePatterns: ['lib/**/*', 'examples/**/*', 'jest.co'],
128
rules: {
139
'@sentry-internal/sdk/no-optional-chaining': 'off',
1410
'@sentry-internal/sdk/no-nullish-coalescing': 'off',
Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1-
import { execSync } from "child_process";
2-
import { exit } from "process";
3-
import {error, log} from "console"
1+
import { execSync } from 'child_process';
2+
import { error, log } from 'console';
3+
import { exit } from 'process';
44

5+
const args = ['--Werror', '-i', '--style=file', 'bindings/cpu_profiler.cc'];
6+
const cmd = `./node_modules/.bin/clang-format ${args.join(' ')}`;
57

6-
const args = ["--Werror", "-i", "--style=file", "bindings/cpu_profiler.cc"];
7-
const cmd = `./node_modules/.bin/clang-format ${args.join(" ")}`;
8+
execSync(cmd);
89

9-
execSync(cmd)
10+
log('clang-format: done, checking tree...');
1011

11-
log("clang-format: done, checking tree...")
12+
const diff = execSync(`git status --short`).toString();
1213

13-
const diff = execSync(`git status --short`).toString()
14-
15-
if(diff) {
16-
error("clang-format: check failed ❌")
17-
exit(1)
14+
if (diff) {
15+
error('clang-format: check failed ❌');
16+
exit(1);
1817
}
1918

20-
log("clang-format: check passed ✅")
21-
19+
log('clang-format: check passed ✅');

packages/profiling-node/esbuild.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ const esbuild = require('esbuild');
33
let missingBindingsPlugin = {
44
name: 'MissingBindings',
55
setup(build) {
6-
build.onResolve({ filter: /\.node$/ }, (args) => ({
6+
build.onResolve({ filter: /\.node$/ }, args => ({
77
path: args.path,
88
namespace: 'missing-bindings',
9-
external: true
9+
external: true,
1010
}));
11-
}
11+
},
1212
};
1313

1414
esbuild.build({
@@ -19,5 +19,5 @@ esbuild.build({
1919
target: 'node16',
2020
bundle: true,
2121
tsconfig: './tsconfig.json',
22-
plugins: [missingBindingsPlugin]
22+
plugins: [missingBindingsPlugin],
2323
});

packages/profiling-node/examples/esbuild.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import esbuild from 'esbuild';
21
import path from 'path';
2+
import esbuild from 'esbuild';
33

44
import { URL, fileURLToPath } from 'url';
55

@@ -13,7 +13,7 @@ esbuild.build({
1313
outdir: path.resolve(__dirname, './dist/esbuild'),
1414
bundle: true,
1515
loader: {
16-
'.node': 'copy'
16+
'.node': 'copy',
1717
},
18-
tsconfig: path.resolve(__dirname, '../tsconfig.json')
18+
tsconfig: path.resolve(__dirname, '../tsconfig.json'),
1919
});

packages/profiling-node/examples/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Sentry.init({
55
dsn: '',
66
integrations: [new profiling.ProfilingIntegration()],
77
tracesSampleRate: 1,
8-
profilesSampleRate: 1
8+
profilesSampleRate: 1,
99
});
1010

1111
const transaction = Sentry.startTransaction({ name: `${process.env['BUNDLER']}-application-build` });

packages/profiling-node/examples/rollup.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const rollupNativePlugin = require('rollup-plugin-natives');
22
const path = require('path');
33

44
const commonjs = require('@rollup/plugin-commonjs');
5-
const {nodeResolve} = require('@rollup/plugin-node-resolve');
5+
const { nodeResolve } = require('@rollup/plugin-node-resolve');
66

77
module.exports = {
88
input: path.resolve(__dirname, './index.js'),
@@ -12,10 +12,10 @@ module.exports = {
1212
},
1313
plugins: [
1414
nodeResolve({
15-
extensions: ['.js', '.ts']
15+
extensions: ['.js', '.ts'],
1616
}),
1717
commonjs({
18-
strictRequires: true
18+
strictRequires: true,
1919
}),
2020
rollupNativePlugin({
2121
// Where we want to physically put the extracted .node files
@@ -24,5 +24,5 @@ module.exports = {
2424
// Path to the same folder, relative to the output bundle js
2525
destDir: path.resolve(__dirname, './dist/rollup'),
2626
}),
27-
]
27+
],
2828
};

packages/profiling-node/examples/webpack.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ module.exports = {
55
entry: path.resolve(__dirname, './index.js'),
66
mode: 'production',
77
optimization: {
8-
minimize: false
8+
minimize: false,
99
},
1010
module: {
1111
rules: [
1212
{
1313
test: /\.node$/,
14-
loader: 'file-loader'
15-
}
16-
]
14+
loader: 'file-loader',
15+
},
16+
],
1717
},
1818
resolve: {
19-
extensions: ['.tsx', '.ts', '.js']
19+
extensions: ['.tsx', '.ts', '.js'],
2020
},
2121
output: {
2222
filename: 'index.js',
2323
path: path.resolve(__dirname, './dist/webpack'),
24-
}
24+
},
2525
};

packages/profiling-node/jest.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ module.exports = {
1313
'^.+\\.tsx?$': [
1414
'ts-jest',
1515
{
16-
tsconfig: 'tsconfig.test.json'
17-
}
18-
]
19-
}
16+
tsconfig: 'tsconfig.test.json',
17+
},
18+
],
19+
},
2020
};

packages/profiling-node/scripts/binaries.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ function getModuleName() {
1111

1212
if (platform === 'darwin' && arch === 'arm64') {
1313
const identifier = [platform, 'arm64', abi.getAbi(process.versions.node, 'node')]
14-
.filter((c) => c !== undefined && c !== null)
14+
.filter(c => c !== undefined && c !== null)
1515
.join('-');
1616
return `sentry_cpu_profiler-${identifier}.node`;
1717
}
1818

1919
const identifier = [platform, arch, stdlib, abi.getAbi(process.versions.node, 'node')]
20-
.filter((c) => c !== undefined && c !== null)
20+
.filter(c => c !== undefined && c !== null)
2121
.join('-');
2222

2323
return `sentry_cpu_profiler-${identifier}.node`;

packages/profiling-node/scripts/check-build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function recompileFromSource() {
1212
let spawn = child_process.spawnSync('npm', ['run', 'build:bindings:configure'], {
1313
stdio: ['inherit', 'inherit', 'pipe'],
1414
env: process.env,
15-
shell: true
15+
shell: true,
1616
});
1717

1818
if (spawn.status !== 0) {
@@ -26,7 +26,7 @@ function recompileFromSource() {
2626
spawn = child_process.spawnSync('npm', ['run', 'build:bindings'], {
2727
stdio: ['inherit', 'inherit', 'pipe'],
2828
env: process.env,
29-
shell: true
29+
shell: true,
3030
});
3131
if (spawn.status !== 0) {
3232
// eslint-disable-next-line no-console

0 commit comments

Comments
 (0)