Skip to content

Commit 38fc478

Browse files
authored
Fix CI (#8)
* clippy fixes * Update egui and re_ui * Sort dependencies * Use `log` crate for logging * Enable more clippy lints * Use latest version of all crates * Fix wasm compilation * Remove dependency on openssl * wasm fix
1 parent b53a8af commit 38fc478

File tree

13 files changed

+466
-460
lines changed

13 files changed

+466
-460
lines changed

Cargo.lock

Lines changed: 340 additions & 367 deletions
Large diffs are not rendered by default.

Cargo.toml

Lines changed: 65 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -18,48 +18,52 @@ targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"]
1818

1919

2020
[dependencies]
21-
eframe = { version = "0.32.3", features = ["glow", "default", "persistence", "ron"] }
22-
egui_extras = { version = "0.32.3", features = ["image", "file", "http"] }
23-
ehttp = { version = "0.5", features = ["native-async"] }
24-
dify = "0.7"
25-
serde = "1"
26-
serde_json = "1.0"
27-
image = "0.25.8"
28-
tempfile = { version = "3.0" }
29-
zip = { version = "5", default-features = false, features = ["deflate"] }
21+
anyhow = "1.0.100"
22+
bytes = "1.10.1"
23+
chrono = { version = "0.4.42", features = ["serde"] }
24+
dify = "0.7.4"
25+
eframe = { version = "0.33.0", features = ["glow", "default", "persistence", "ron"] }
26+
egui_extras = { version = "0.33.0", features = ["image", "file", "http"] }
27+
egui_inbox = { version = "0.10.0", features = ["async", "tokio"] }
28+
ehttp = { version = "0.5.0", features = ["native-async"] }
29+
env_logger = { version = "0.11.8", default-features=false, features = ["auto-color", "humantime"] }
3030
flate2 = { version = "1.1" }
31-
tar = { version = "0.4" }
32-
chrono = { version = "0.4", features = ["serde"] }
33-
octocrab = { version = "0.45.0", default-features = false, features = ["stream"] }
34-
octocrab-wasm = { path = "crates/octocrab-wasm" }
35-
egui_inbox = { version = "0.9.0", features = ["async", "tokio"] }
36-
futures = "0.3"
37-
re_ui = "0.26.0-alpha.1+dev"
31+
futures = "0.3.31"
3832
getrandom = { version = "0.3", features = ["wasm_js"] }
39-
anyhow = "1.0.99"
4033
graphql_client = "0.14.0"
41-
thiserror = "1.0.69"
42-
bytes = "1.10.1"
43-
reqwest = "0.12.23"
44-
hello_egui_utils = "0.9.0"
45-
serde_urlencoded = "0.7"
46-
web-time = "1"
34+
hello_egui_utils = "0.10.0"
35+
image = "0.25.8"
36+
log = "0.4.28"
37+
octocrab = { version = "0.47.0", default-features = false, features = ["stream"] }
38+
octocrab-wasm = { path = "crates/octocrab-wasm" }
39+
re_ui = { git = "https://github.com/rerun-io/rerun", branch = "main" }
40+
reqwest = { version = "0.12.23", default-features = false, features = [
41+
"rustls-tls",
42+
] }
43+
serde = "1.0"
44+
serde_json = "1.0"
45+
serde_urlencoded = "0.7.1"
46+
tar = { version = "0.4.44" }
47+
tempfile = { version = "3.23" }
48+
thiserror = "2.0.17"
49+
web-time = "1.1"
50+
zip = { version = "6.0.0", default-features = false, features = ["deflate"] }
4751

4852
# native:
4953
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
5054
axum = "0.8.6"
55+
clap = { version = "4.5", features = ["derive"] }
5156
env_logger = "0.11.8"
57+
git2 = { version = "0.20.2" }
5258
ignore = { version = "0.4" }
53-
clap = { version = "4.0", features = ["derive"] }
54-
git2 = { version = "0.18" }
55-
tokio = { version = "1.0", features = ["full"] }
59+
tokio = { version = "1.47", features = ["full"] }
5660

5761
# web:
5862
[target.'cfg(target_arch = "wasm32")'.dependencies]
59-
wasm-bindgen-futures = { version = "0.4" }
60-
wasm-bindgen = { version = "0.2" }
61-
js-sys = { version = "0.3" }
62-
web-sys = { version = "0.3", features = ["Window", "Location", "History", "Navigator", "Clipboard", "Performance"] }
63+
js-sys = { version = "0.3.81" }
64+
wasm-bindgen = { version = "0.2.104" }
65+
wasm-bindgen-futures = { version = "0.4.54" }
66+
web-sys = { version = "0.3.81", features = ["Window", "Location", "History", "Navigator", "Clipboard", "Performance"] }
6367

6468
[profile.release]
6569
opt-level = 2 # fast and small wasm
@@ -72,12 +76,12 @@ opt-level = 2
7276
[patch.crates-io]
7377

7478
# If you want to use the bleeding edge version of egui and eframe:
75-
egui = { git = "https://github.com/emilk/egui", branch = "main" }
76-
eframe = { git = "https://github.com/emilk/egui", branch = "main" }
77-
egui_extras = { git = "https://github.com/emilk/egui", branch = "main" }
79+
# egui = { git = "https://github.com/emilk/egui", branch = "main" }
80+
# eframe = { git = "https://github.com/emilk/egui", branch = "main" }
81+
# egui_extras = { git = "https://github.com/emilk/egui", branch = "main" }
7882

79-
re_ui = { git = "https://github.com/rerun-io/rerun", branch = "main" }
80-
egui_commonmark = { git = "https://github.com/rerun-io/egui_commonmark.git", branch = "lucas/update-egui-main" }
83+
# re_ui = { git = "https://github.com/rerun-io/rerun", branch = "main" }
84+
# egui_commonmark = { git = "https://github.com/rerun-io/egui_commonmark.git", branch = "lucas/update-egui-main" }
8185

8286
# If you fork https://github.com/emilk/egui you can test with:
8387
# egui = { path = "../egui/crates/egui" }
@@ -123,23 +127,28 @@ allow_attributes = "warn"
123127
as_ptr_cast_mut = "warn"
124128
await_holding_lock = "warn"
125129
bool_to_int_with_if = "warn"
130+
branches_sharing_code = "warn"
126131
char_lit_as_u8 = "warn"
127132
checked_conversions = "warn"
128133
clear_with_drain = "warn"
129134
cloned_instead_of_copied = "warn"
130135
dbg_macro = "warn"
131136
debug_assert_with_mut_call = "warn"
137+
default_union_representation = "warn"
132138
derive_partial_eq_without_eq = "warn"
133139
disallowed_macros = "warn" # See clippy.toml
134140
disallowed_methods = "warn" # See clippy.toml
135141
disallowed_names = "warn" # See clippy.toml
136142
disallowed_script_idents = "warn" # See clippy.toml
137143
disallowed_types = "warn" # See clippy.toml
144+
doc_comment_double_space_linebreaks = "warn"
138145
doc_include_without_cfg = "warn"
139146
doc_link_with_quotes = "warn"
140147
doc_markdown = "warn"
148+
elidable_lifetime_names = "warn"
141149
empty_enum = "warn"
142150
empty_enum_variants_with_brackets = "warn"
151+
empty_line_after_outer_attr = "warn"
143152
enum_glob_use = "warn"
144153
equatable_if_let = "warn"
145154
exit = "warn"
@@ -155,8 +164,12 @@ fn_params_excessive_bools = "warn"
155164
fn_to_numeric_cast_any = "warn"
156165
from_iter_instead_of_collect = "warn"
157166
get_unwrap = "warn"
167+
if_let_mutex = "warn"
168+
ignore_without_reason = "warn"
158169
implicit_clone = "warn"
170+
implied_bounds_in_impls = "warn"
159171
imprecise_flops = "warn"
172+
inconsistent_struct_constructor = "warn"
160173
index_refutable_slice = "warn"
161174
inefficient_to_string = "warn"
162175
infinite_loop = "warn"
@@ -187,6 +200,7 @@ manual_instant_elapsed = "warn"
187200
manual_is_power_of_two = "warn"
188201
manual_is_variant_and = "warn"
189202
manual_let_else = "warn"
203+
manual_midpoint = "warn" # NOTE `midpoint` is often a lot slower for floats, so we have our own `emath::fast_midpoint` function.
190204
manual_ok_or = "warn"
191205
manual_string_new = "warn"
192206
map_err_ignore = "warn"
@@ -209,12 +223,16 @@ needless_for_each = "warn"
209223
needless_pass_by_ref_mut = "warn"
210224
needless_pass_by_value = "warn"
211225
negative_feature_names = "warn"
226+
non_std_lazy_statics = "warn"
212227
non_zero_suggestions = "warn"
213228
nonstandard_macro_braces = "warn"
214229
option_as_ref_cloned = "warn"
215230
option_option = "warn"
216231
path_buf_push_overwrite = "warn"
217232
pathbuf_init_then_push = "warn"
233+
precedence_bits = "warn"
234+
print_stderr = "warn"
235+
print_stdout = "warn"
218236
ptr_as_ptr = "warn"
219237
ptr_cast_constness = "warn"
220238
pub_underscore_fields = "warn"
@@ -224,13 +242,16 @@ readonly_write_lock = "warn"
224242
redundant_type_annotations = "warn"
225243
ref_as_ptr = "warn"
226244
ref_option_ref = "warn"
245+
ref_patterns = "warn"
227246
rest_pat_in_fully_bound_structs = "warn"
247+
return_and_then = "warn"
228248
same_functions_in_if_condition = "warn"
229249
semicolon_if_nothing_returned = "warn"
230250
set_contains_or_insert = "warn"
231251
should_panic_without_expect = "warn"
232252
single_char_pattern = "warn"
233253
single_match_else = "warn"
254+
single_option_map = "warn"
234255
str_split_at_newline = "warn"
235256
str_to_string = "warn"
236257
string_add = "warn"
@@ -245,15 +266,20 @@ too_long_first_doc_paragraph = "warn"
245266
too_many_lines = "warn"
246267
trailing_empty_array = "warn"
247268
trait_duplication_in_bounds = "warn"
269+
transmute_ptr_to_ptr = "warn"
248270
tuple_array_conversions = "warn"
249271
unchecked_duration_subtraction = "warn"
250272
undocumented_unsafe_blocks = "warn"
251273
unimplemented = "warn"
252274
uninhabited_references = "warn"
253275
uninlined_format_args = "warn"
254276
unnecessary_box_returns = "warn"
277+
unnecessary_debug_formatting = "warn"
255278
unnecessary_literal_bound = "warn"
279+
unnecessary_safety_comment = "warn"
256280
unnecessary_safety_doc = "warn"
281+
unnecessary_self_imports = "warn"
282+
unnecessary_semicolon = "warn"
257283
unnecessary_struct_initialization = "warn"
258284
unnecessary_wraps = "warn"
259285
unnested_or_patterns = "warn"
@@ -263,11 +289,15 @@ unused_self = "warn"
263289
unused_trait_names = "warn"
264290
unwrap_used = "warn"
265291
use_self = "warn"
292+
useless_let_if_seq = "warn"
266293
useless_transmute = "warn"
267294
verbose_file_reads = "warn"
268295
wildcard_dependencies = "warn"
269296
wildcard_imports = "warn"
270297
zero_sized_map_values = "warn"
271298

299+
# TODO: enable?
300+
missing_errors_doc = "allow"
301+
272302
manual_range_contains = "allow" # this is better on 'allow'
273303
map_unwrap_or = "allow" # this is better on 'allow'

crates/octocrab-wasm/Cargo.toml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,20 @@ version = "0.1.0"
44
edition = "2024"
55

66
[dependencies]
7-
octocrab = { version = "0.45.0", default-features = false }
7+
octocrab = { version = "0.47.0", default-features = false }
88

99
[target.'cfg(target_arch = "wasm32")'.dependencies]
1010
http-body = "1.0.1"
1111
tower = "0.5.2"
1212
http = "1.3.1"
1313
http-body-util = "0.1.3"
14-
bytes = "1"
15-
wasm-bindgen-futures = "0.4"
16-
futures = "0.3"
17-
reqwest = "0.12"
18-
thiserror = "2"
14+
bytes = "1.10"
15+
wasm-bindgen-futures = "0.4.54"
16+
futures = "0.3.31"
17+
reqwest = { version = "0.12.23", default-features = false, features = [
18+
"rustls-tls",
19+
] }
20+
thiserror = "2.0"
1921

2022
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
21-
octocrab = { version = "0.45.0", features = ["default-client"] }
23+
octocrab = { version = "0.47.0", features = ["default-client"] }

src/github/auth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ impl GitHubAuth {
239239
self.sender.send(SystemCommand::Refresh).ok();
240240
}
241241
AuthEvent::Error(error) => {
242-
eprintln!("Auth error: {error}");
242+
log::error!("Auth error: {error}");
243243
}
244244
}
245245
}

src/github/auth/native.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn login_github(ctx: &Context, tx: AuthSender) {
1111
let ctx = ctx.clone();
1212
spawn(async move {
1313
if let Err(err) = login(ctx, tx).await {
14-
eprintln!("Error during GitHub login: {err:?}");
14+
log::error!("Error during GitHub login: {err:?}");
1515
}
1616
});
1717
}

src/github/pr.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,12 @@ async fn get_pr_commits(repo: &RepoClient, pr: PrNumber) -> Result<PrWithCommits
233233
// to query all check suites and group them by workflow.
234234
let mut last_suite_per_workflow = HashMap::new();
235235

236-
if let Some(suites) = commit.check_suites {
237-
if let Some(nodes) = suites.nodes {
238-
for node in nodes.into_iter().flatten() {
239-
if let Some(workflow_run) = node.workflow_run.clone() {
240-
last_suite_per_workflow.insert(workflow_run.workflow.id, node);
241-
}
236+
if let Some(suites) = commit.check_suites
237+
&& let Some(nodes) = suites.nodes
238+
{
239+
for node in nodes.into_iter().flatten() {
240+
if let Some(workflow_run) = node.workflow_run.clone() {
241+
last_suite_per_workflow.insert(workflow_run.workflow.id, node);
242242
}
243243
}
244244
}
@@ -276,10 +276,10 @@ async fn get_pr_commits(repo: &RepoClient, pr: PrNumber) -> Result<PrWithCommits
276276
status = CommitState::Pending;
277277
}
278278

279-
if let Some(run) = &suite.workflow_run {
280-
if let Some(db_id) = run.database_id {
281-
workflow_run_ids.insert(db_id as u64);
282-
}
279+
if let Some(run) = &suite.workflow_run
280+
&& let Some(db_id) = run.database_id
281+
{
282+
workflow_run_ids.insert(db_id as u64);
283283
}
284284
}
285285

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl DiffSource {
3434
if let Ok(link) = url.parse() {
3535
Self::Pr(link)
3636
} else if let Some(link) = parse_github_artifact_url(url) {
37-
return Self::GHArtifact(link);
37+
Self::GHArtifact(link)
3838
} else {
3939
// Try to load it as direct zip/tar.gz URL
4040
Self::Archive(DataReference::Url(url.to_owned()))

src/main.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ use kitdiff::config::Config;
88

99
#[cfg(not(target_arch = "wasm32"))]
1010
fn main() -> eframe::Result<()> {
11+
env_logger::init();
12+
1113
let rt = tokio::runtime::Builder::new_multi_thread()
1214
.enable_all()
1315
.build()
@@ -32,7 +34,7 @@ fn main() -> eframe::Result<()> {
3234
}
3335

3436
#[cfg(target_arch = "wasm32")]
35-
fn parse_url_query_params() -> Option<DiffSource> {
37+
fn parse_url_query_params() -> Option<kitdiff::DiffSource> {
3638
if let Some(window) = web_sys::window() {
3739
if let Ok(search) = window.location().search() {
3840
let search = search.strip_prefix('?').unwrap_or(&search);
@@ -43,7 +45,7 @@ fn parse_url_query_params() -> Option<DiffSource> {
4345
if key == "url" {
4446
// URL decode the value
4547
let decoded_url = js_sys::decode_uri_component(value).ok()?.as_string()?;
46-
return Some(DiffSource::from_url(&decoded_url));
48+
return Some(kitdiff::DiffSource::from_url(&decoded_url));
4749
}
4850
}
4951
}

src/native_loaders/file_loader.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,11 @@ impl FileLoader {
3535
let types = types_builder.build().expect("Failed to build types");
3636

3737
for entry in WalkBuilder::new(&base_path).types(types).build().flatten() {
38-
if entry.file_type().is_some_and(|ft| ft.is_file()) {
39-
if let Some(snapshot) = try_create_snapshot(entry.path(), &base_path) {
40-
if sender.send(Some(snapshot)).is_err() {
41-
break;
42-
};
43-
}
38+
if entry.file_type().is_some_and(|ft| ft.is_file())
39+
&& let Some(snapshot) = try_create_snapshot(entry.path(), &base_path)
40+
&& sender.send(Some(snapshot)).is_err()
41+
{
42+
break;
4443
}
4544
}
4645

0 commit comments

Comments
 (0)