From 8a1bb7a5afda27367a1a93b30be9a3b35798d2df Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Mon, 26 Jun 2023 11:56:12 -0400 Subject: [PATCH] Fix version number in playground (#5372) ## Summary `v0.0.275` in the top-right was showing `v0.0.0` at all times. ## Test Plan ![Screen Shot 2023-06-26 at 11 31 16 AM](https://github.com/astral-sh/ruff/assets/1309177/e6cd0e19-6a5f-4b46-a060-54f492524737) --- crates/ruff/src/lib.rs | 2 ++ crates/ruff_wasm/src/lib.rs | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/ruff/src/lib.rs b/crates/ruff/src/lib.rs index f1d884303e..2a69194fad 100644 --- a/crates/ruff/src/lib.rs +++ b/crates/ruff/src/lib.rs @@ -9,6 +9,8 @@ pub use ruff_python_ast::source_code::round_trip; pub use rule_selector::RuleSelector; pub use rules::pycodestyle::rules::IOError; +pub const VERSION: &str = env!("CARGO_PKG_VERSION"); + mod autofix; mod checkers; mod codes; diff --git a/crates/ruff_wasm/src/lib.rs b/crates/ruff_wasm/src/lib.rs index 2a449d0864..b113491b44 100644 --- a/crates/ruff_wasm/src/lib.rs +++ b/crates/ruff_wasm/src/lib.rs @@ -21,8 +21,6 @@ use ruff::settings::{defaults, flags, Settings}; use ruff_diagnostics::Edit; use ruff_python_ast::source_code::{Indexer, Locator, SourceLocation, Stylist}; -const VERSION: &str = env!("CARGO_PKG_VERSION"); - #[wasm_bindgen(typescript_custom_section)] const TYPES: &'static str = r#" export interface Diagnostic { @@ -87,7 +85,7 @@ pub fn run() { #[wasm_bindgen] #[allow(non_snake_case)] pub fn currentVersion() -> JsValue { - JsValue::from(VERSION) + JsValue::from(ruff::VERSION) } #[wasm_bindgen]