From 0bc48070f305bdf5021a98068950fb9191878cae Mon Sep 17 00:00:00 2001 From: David Sherret Date: Sat, 13 Jan 2024 20:52:45 -0500 Subject: [PATCH] chore: fix formatting --- deployment/npm/index.js | 4 ++-- deployment/npm/setup.js | 12 ++++++------ dprint.json | 11 +++++------ scripts/generate_release_notes.ts | 2 +- src/generation/generate.rs | 2 +- src/wasm_plugin.rs | 2 +- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/deployment/npm/index.js b/deployment/npm/index.js index a174b45..07952bf 100644 --- a/deployment/npm/index.js +++ b/deployment/npm/index.js @@ -3,9 +3,9 @@ * @returns {string} */ function getPath() { - return require("path").join(__dirname, "plugin.wasm"); + return require("path").join(__dirname, "plugin.wasm"); } module.exports = { - getPath, + getPath, }; diff --git a/deployment/npm/setup.js b/deployment/npm/setup.js index b187f32..30dfb1d 100644 --- a/deployment/npm/setup.js +++ b/deployment/npm/setup.js @@ -6,10 +6,10 @@ const wasmPath = path.join(__dirname, "../../target/wasm32-unknown-unknown/relea fs.copyFileSync(wasmPath, path.join(__dirname, "plugin.wasm")); if (args.length > 0) { - // update the version based on the first argument - const packageJsonPath = path.join(__dirname, "package.json"); - const packageJsonText = fs.readFileSync(packageJsonPath, "utf8"); - const packageJson = JSON.parse(packageJsonText); - packageJson.version = args[0]; - fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, undefined, 2) + "\n"); + // update the version based on the first argument + const packageJsonPath = path.join(__dirname, "package.json"); + const packageJsonText = fs.readFileSync(packageJsonPath, "utf8"); + const packageJson = JSON.parse(packageJsonText); + packageJson.version = args[0]; + fs.writeFileSync(packageJsonPath, JSON.stringify(packageJson, undefined, 2) + "\n"); } diff --git a/dprint.json b/dprint.json index 5245cda..1bb2cf4 100644 --- a/dprint.json +++ b/dprint.json @@ -1,11 +1,10 @@ { - "incremental": true, - "indentWidth": 2, "exec": { - "associations": "**/*.rs", - "rustfmt": "rustfmt" + "commands": [{ + "command": "rustfmt --edition 2021 --config imports_granularity=item", + "exts": ["rs"] + }] }, - "includes": ["**/*.{ts,tsx,js,jsx,cjs,mjs,json,md,toml,rs}"], "excludes": [ "**/node_modules", "**/*-lock.json", @@ -16,6 +15,6 @@ "https://plugins.dprint.dev/json-0.14.0.wasm", "https://plugins.dprint.dev/markdown-0.12.1.wasm", "https://plugins.dprint.dev/toml-0.5.3.wasm", - "https://plugins.dprint.dev/exec-0.3.1.json@9351b67ec7a6b58a69201c2834cba38cb3d191080aefc6422fb1320f03c8fc4d" + "https://plugins.dprint.dev/exec-0.4.2.json@ca3c3d1cc1105b4ac1c31afdb26791a90209f13a5950f8de00dcab5e5ee293a7" ] } diff --git a/scripts/generate_release_notes.ts b/scripts/generate_release_notes.ts index 1605162..6daa31c 100644 --- a/scripts/generate_release_notes.ts +++ b/scripts/generate_release_notes.ts @@ -2,7 +2,7 @@ import { generateChangeLog } from "https://raw.githubusercontent.com/dprint/auto const version = Deno.args[0]; const changelog = await generateChangeLog({ - versionTo: version, + versionTo: version, }); const text = `## Changes diff --git a/src/generation/generate.rs b/src/generation/generate.rs index 6d1ebd4..b3f3282 100644 --- a/src/generation/generate.rs +++ b/src/generation/generate.rs @@ -1,6 +1,6 @@ use dockerfile_parser::*; -use dprint_core::formatting::ir_helpers::SingleLineOptions; use dprint_core::formatting::ir_helpers::gen_from_raw_string; +use dprint_core::formatting::ir_helpers::SingleLineOptions; use dprint_core::formatting::*; use super::context::Context; diff --git a/src/wasm_plugin.rs b/src/wasm_plugin.rs index f5cf5ca..b3f33f6 100644 --- a/src/wasm_plugin.rs +++ b/src/wasm_plugin.rs @@ -5,8 +5,8 @@ use dprint_core::generate_plugin_code; use dprint_core::plugins::FileMatchingInfo; use dprint_core::plugins::FormatResult; use dprint_core::plugins::PluginInfo; -use dprint_core::plugins::SyncPluginInfo; use dprint_core::plugins::SyncPluginHandler; +use dprint_core::plugins::SyncPluginInfo; use std::path::Path; use super::configuration::resolve_config;