Skip to content

Commit f380530

Browse files
No Authortexodus
authored andcommitted
Apply lint
Signed-off-by: Andrew Stein <[email protected]>
1 parent 0522765 commit f380530

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+190
-185
lines changed

packages/perspective-react/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
},
3030
"devDependencies": {
3131
"@finos/perspective-esbuild-plugin": "workspace:^",
32+
"typescript": "~5.2.2",
3233
"zx": "^8.3.0"
3334
}
3435
}

packages/perspective-viewer-d3fc/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
"@types/d3": "^7.0.0",
6464
"@finos/perspective-esbuild-plugin": "workspace:^",
6565
"@finos/perspective-test": "workspace:^",
66-
"@prospective.co/procss": "^0.1.16"
66+
"@prospective.co/procss": "^0.1.16",
67+
"typescript": "~5.2.2"
6768
}
6869
}

pnpm-lock.yaml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/bundle/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ fn build(pkg: Option<&str>, is_release: bool, features: Vec<String>) {
6262
fn bindgen(outdir: &Path, artifact: &str, is_release: bool) {
6363
let input = Path::new("../target/wasm32-unknown-unknown")
6464
.join(if is_release { "release" } else { "debug" })
65-
.join(format!("{}.wasm", artifact));
65+
.join(format!("{artifact}.wasm"));
6666

6767
Bindgen::new()
6868
.web(true)

rust/perspective-client/src/rust/client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ mod name_registry {
106106
} else {
107107
let mut guard = CLIENT_ID_GEN.lock()?;
108108
*guard += 1;
109-
Ok(format!("client-{}", guard))
109+
Ok(format!("client-{guard}"))
110110
}
111111
}
112112
}
@@ -273,7 +273,7 @@ impl Client {
273273
msg_id,
274274
entity_id: "".to_string(),
275275
client_resp: Some(ClientResp::ServerError(ServerError {
276-
message: format!("{}", message),
276+
message: format!("{message}"),
277277
status_code: 2,
278278
})),
279279
};
@@ -389,7 +389,7 @@ impl Client {
389389
self.subscribe_once(req, on_update).await?;
390390
receiver
391391
.await
392-
.map_err(|_| ClientError::Unknown(format!("Internal error for req {}", req)))
392+
.map_err(|_| ClientError::Unknown(format!("Internal error for req {req}")))
393393
}
394394

395395
pub(crate) fn get_features(&self) -> ClientResult<Features> {

rust/perspective-client/src/rust/config/aggregates.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ impl Display for SingleAggregate {
144144
Self::Min => "min",
145145
};
146146

147-
write!(fmt, "{}", term)
147+
write!(fmt, "{term}")
148148
}
149149
}
150150

@@ -182,7 +182,7 @@ impl FromStr for SingleAggregate {
182182
"high minus low" => Ok(Self::HighMinusLow),
183183
"stddev" => Ok(Self::StdDev),
184184
"var" => Ok(Self::Var),
185-
x => Err(format!("Unknown aggregate `{}`", x)),
185+
x => Err(format!("Unknown aggregate `{x}`")),
186186
}
187187
}
188188
}
@@ -226,12 +226,12 @@ impl From<&'static str> for Aggregate {
226226
impl Display for Aggregate {
227227
fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
228228
match self {
229-
Self::SingleAggregate(x) => write!(fmt, "{}", x)?,
229+
Self::SingleAggregate(x) => write!(fmt, "{x}")?,
230230
Self::MultiAggregate(MultiAggregate::WeightedMean, x) => {
231-
write!(fmt, "weighted mean by {}", x)?
231+
write!(fmt, "weighted mean by {x}")?
232232
},
233-
Self::MultiAggregate(MultiAggregate::MaxBy, x) => write!(fmt, "max by {}", x)?,
234-
Self::MultiAggregate(MultiAggregate::MinBy, x) => write!(fmt, "min by {}", x)?,
233+
Self::MultiAggregate(MultiAggregate::MaxBy, x) => write!(fmt, "max by {x}")?,
234+
Self::MultiAggregate(MultiAggregate::MinBy, x) => write!(fmt, "min by {x}")?,
235235
};
236236
Ok(())
237237
}

rust/perspective-client/src/rust/config/column_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl TryFrom<&str> for ColumnType {
5454
} else if val == "datetime" {
5555
Ok(Self::Datetime)
5656
} else {
57-
Err(ClientError::Internal(format!("Unknown type {}", val)))
57+
Err(ClientError::Internal(format!("Unknown type {val}")))
5858
}
5959
}
6060
}

rust/perspective-client/src/rust/config/expressions.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -668,10 +668,8 @@ fn test_completions_insert_text_matches_label() {
668668
let label = comp.label;
669669
let insert_text = comp.insert_text;
670670
assert!(
671-
insert_text.starts_with(&label),
672-
"insert_text for label {label} does not start with {label}:\n {insert_text}",
673-
label = label,
674-
insert_text = insert_text
671+
insert_text.starts_with(label),
672+
"insert_text for label {label} does not start with {label}:\n {insert_text}"
675673
);
676674
}
677675
}

rust/perspective-client/src/rust/config/filters.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ impl Default for Scalar {
4848
impl Display for Scalar {
4949
fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5050
match self {
51-
Self::Float(x) => write!(fmt, "{}", x),
52-
Self::String(x) => write!(fmt, "{}", x),
53-
Self::Bool(x) => write!(fmt, "{}", x),
51+
Self::Float(x) => write!(fmt, "{x}"),
52+
Self::String(x) => write!(fmt, "{x}"),
53+
Self::Bool(x) => write!(fmt, "{x}"),
5454
Self::Null => write!(fmt, ""),
5555
}
5656
}
@@ -82,12 +82,12 @@ impl Display for FilterTerm {
8282
fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8383
match self {
8484
Self::Scalar(x) => {
85-
write!(fmt, "{}", x)?;
85+
write!(fmt, "{x}")?;
8686
},
8787
Self::Array(xs) => write!(
8888
fmt,
8989
"{}",
90-
Itertools::intersperse(xs.iter().map(|x| format!("{}", x)), ",".to_owned())
90+
Itertools::intersperse(xs.iter().map(|x| format!("{x}")), ",".to_owned())
9191
.collect::<String>()
9292
)?,
9393
}

rust/perspective-client/src/rust/table.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl TableReadFormat {
5757
Some("arrow") => Some(TableReadFormat::Arrow),
5858
Some("ndjson") => Some(TableReadFormat::Ndjson),
5959
None => None,
60-
Some(x) => return Err(format!("Unknown format \"{}\"", x)),
60+
Some(x) => return Err(format!("Unknown format \"{x}\"")),
6161
})
6262
}
6363
}
@@ -92,7 +92,7 @@ pub struct TableInitOptions {
9292

9393
impl TableInitOptions {
9494
pub fn set_name<D: Display>(&mut self, name: D) {
95-
self.name = Some(format!("{}", name))
95+
self.name = Some(format!("{name}"))
9696
}
9797
}
9898

0 commit comments

Comments
 (0)