Skip to content

Commit 5de1be5

Browse files
committed
fixes
1 parent 56c540b commit 5de1be5

File tree

6 files changed

+20
-14
lines changed

6 files changed

+20
-14
lines changed

.github/workflows/pull_request.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
run: |
5151
cargo fmt --all --check
5252
taplo format --check
53-
biome ci
53+
biome format
5454
5555
actionlint:
5656
name: Lint GitHub Actions
@@ -91,10 +91,15 @@ jobs:
9191
cache-base: main
9292
env:
9393
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
94+
- name: Setup Biome
95+
uses: biomejs/setup-biome@v2
96+
with:
97+
version: latest
9498
- name: Run Lints
9599
run: |
96100
cargo clippy
97101
cargo run -p rules_check
102+
biome lint
98103
99104
test:
100105
name: Test

crates/pglt_workspace/src/configuration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ pub fn strip_jsonc_comments(jsonc_input: &str) -> String {
241241
json_output.push(last_char);
242242
}
243243
} else {
244-
json_output.push_str(" ");
244+
json_output.push(' ');
245245
}
246246
last_char = Some(cur_char);
247247
}

crates/pglt_workspace/src/workspace_types.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ fn schema_object_type<'a>(
262262
let has_defaults = schema
263263
.metadata
264264
.as_ref()
265-
.map_or(false, |metadata| metadata.default.is_some());
265+
.is_some_and(|metadata| metadata.default.is_some());
266266

267267
(ts_type, is_nullable || has_defaults, description)
268268
}
@@ -375,7 +375,7 @@ pub fn generate_type<'a>(
375375
let current_module = AnyJsDeclaration::from(
376376
make::ts_interface_declaration(
377377
make::token(T![interface]),
378-
make::ts_identifier_binding(make::ident(name)).into(),
378+
make::ts_identifier_binding(make::ident(name)),
379379
make::token(T!['{']),
380380
make::ts_type_member_list(members),
381381
make::token(T!['}']),
@@ -392,7 +392,7 @@ pub fn generate_type<'a>(
392392
let current_module = AnyJsDeclaration::from(
393393
make::ts_type_alias_declaration(
394394
make::token(T![type]),
395-
make::ts_identifier_binding(make::ident(name)).into(),
395+
make::ts_identifier_binding(make::ident(name)),
396396
make::token(T![=]),
397397
ts_type,
398398
)

packages/@pglt/backend-jsonrpc/src/transport.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ export class Transport {
126126
* @param params Parameters object the remote method should be called with
127127
* @return Promise resolving with the value returned by the remote method, or rejecting with an RPC error if the remote call failed
128128
*/
129+
// biome-ignore lint/suspicious/noExplicitAny: if i change it to Promise<unknown> typescript breaks
129130
request(method: string, params: unknown): Promise<any> {
130131
return new Promise((resolve, reject) => {
131132
const id = this.nextRequestId++;

packages/@pglt/pglt/scripts/generate-packages.mjs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async function downloadSchema(releaseTag, githubToken) {
2222
const response = await fetch(assetUrl.trim(), {
2323
headers: {
2424
Authorization: `token ${githubToken}`,
25-
Accept: `application/octet-stream`,
25+
Accept: "application/octet-stream",
2626
},
2727
});
2828

@@ -46,7 +46,7 @@ async function downloadBinary(platform, arch, os, releaseTag, githubToken) {
4646
const response = await fetch(assetUrl.trim(), {
4747
headers: {
4848
Authorization: `token ${githubToken}`,
49-
Accept: `application/octet-stream`,
49+
Accept: "application/octet-stream",
5050
},
5151
});
5252

@@ -179,15 +179,15 @@ function copySchemaToNativePackage(platform, arch) {
179179
const buildName = getBuildName(platform, arch);
180180
const packageRoot = resolve(PACKAGES_PGLT_ROOT, buildName);
181181

182-
const schemaSrc = resolve(PGLT_ROOT, `schema.json`);
183-
const schemaTarget = resolve(packageRoot, `schema.json`);
182+
const schemaSrc = resolve(PGLT_ROOT, "schema.json");
183+
const schemaTarget = resolve(packageRoot, "schema.json");
184184

185185
if (!fs.existsSync(schemaSrc)) {
186186
console.error(`schema.json not found at: ${schemaSrc}`);
187187
process.exit(1);
188188
}
189189

190-
console.info(`Copying schema.json`);
190+
console.info("Copying schema.json");
191191
fs.copyFileSync(schemaSrc, schemaTarget);
192192
fs.chmodSync(schemaTarget, 0o666);
193193
}
@@ -224,7 +224,7 @@ function getVersion(releaseTag, isPrerelease) {
224224

225225
(async function main() {
226226
const githubToken = process.env.GITHUB_TOKEN;
227-
let releaseTag = process.env.RELEASE_TAG;
227+
const releaseTag = process.env.RELEASE_TAG;
228228
assert(githubToken, "GITHUB_TOKEN not defined!");
229229
assert(releaseTag, "RELEASE_TAG not defined!");
230230

xtask/codegen/src/generate_bindings.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ pub fn generate_bindings(mode: Mode) -> Result<()> {
183183
make::token(T!['}']),
184184
),
185185
make::token(T![from]),
186-
make::js_module_source(make::js_string_literal("./transport")).into(),
186+
make::js_module_source(make::js_string_literal("./transport")),
187187
)
188188
.with_type_token(make::token(T![type]))
189189
.build(),
@@ -316,7 +316,7 @@ pub fn generate_bindings(mode: Mode) -> Result<()> {
316316
AnyJsExportClause::AnyJsDeclarationClause(AnyJsDeclarationClause::TsTypeAliasDeclaration(
317317
make::ts_type_alias_declaration(
318318
make::token(T![type]),
319-
make::ts_identifier_binding(make::ident("Configuration")).into(),
319+
make::ts_identifier_binding(make::ident("Configuration")),
320320
make::token(T![=]),
321321
AnyTsType::TsReferenceType(
322322
make::ts_reference_type(AnyTsName::JsReferenceIdentifier(
@@ -335,7 +335,7 @@ pub fn generate_bindings(mode: Mode) -> Result<()> {
335335
AnyJsExportClause::AnyJsDeclarationClause(AnyJsDeclarationClause::TsInterfaceDeclaration(
336336
make::ts_interface_declaration(
337337
make::token(T![interface]),
338-
make::ts_identifier_binding(make::ident("Workspace")).into(),
338+
make::ts_identifier_binding(make::ident("Workspace")),
339339
make::token(T!['{']),
340340
make::ts_type_member_list(member_definitions),
341341
make::token(T!['}']),

0 commit comments

Comments
 (0)