chore: make the workspace clippy-clean under -D warnings - #64
Merged
Merged
Conversation
Resolves clippy::type_complexity in files whose only change is the alias. Aliases are transparent, so no Rust or Python signature changes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
cargo clippy --fix output plus hand fixes: legacy numeric constants, needless_range_loop (iteration order and float summation order kept), manual_clamp, manual_memcpy, vec_init_then_push, large_enum_variant (private etf_trick::Source boxed), field_reassign_with_default, and the remaining type_complexity aliases in files that also had other fixes. One targeted allow: unnecessary_to_owned in MicrostructuralFeaturesGenerator. No numeric behaviour or public API changes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Private pyopenquant helper build_labeling_events now takes a LabelingEventArgs struct. Public openquant functions and #[pyfunction]s whose argument list is the public/Python signature get a targeted #[allow(clippy::too_many_arguments)] with a one-line reason. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ci.yml, release.yml and the justfile now all run cargo clippy --workspace --all-targets --all-features -- -D warnings, which makes the clippy.toml comment true; docs updated to match. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
CI's floating stable (1.98) flags six sites that 1.88 does not: unnecessary_unwrap in cla and codependence, manual_is_multiple_of in hpc_parallel, a dead assignment in streaming_hpc, needless_range_loop in a bench and useless_conversion in a test. All are behavior-preserving; the codependence match keeps a NaN correlation on the bivariate branch, and progress_every is validated > 0 so is_multiple_of is equivalent. Add rust-toolchain.toml so -D warnings is reproducible. Refs #34 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
Author
|
Review follow-up (pushed b003c10):
|
The prose changed (the clippy line), so the freshness gate will rightly ask for a re-read once CI checks out full history (#62). Re-ran the page's Rust commands on this branch: build, the fast test suite (243 passed), fmt, clippy -D warnings and the API-drift check all succeed as written. Refs #34 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Sep 19, 2026
Conflict in microstructural_features.rs: keep main's fix for the duplicated first tick threshold (#67) and move the unnecessary_to_owned allow onto the let binding that now holds the to_vec() call. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #34
Pure refactor: makes
cargo clippy --workspace --all-targets --all-features -- -D warningspass and makes CI, release andjust clippyrun that one command. No numeric behaviour, public Rust API, or Python-visible name/signature changes.Warning counts
Counted as unique
(lint, file, line, column)diagnostics fromcargo clippy --workspace --all-targets --all-features --message-format=json(clippy 1.88.0), de-duplicated across the lib/test builds of the same file. (The issue's "~160 warning lines" counts the duplicated text output.)clippy --fixFixed vs. allowed per lint
Every
#[allow]added (21)No crate/module-level allows;
clippy.tomlthresholds untouched.#[allow(clippy::too_many_arguments)]:openquant::hyperparameter_tuning::randomized_search(8)grid_search's arguments plusn_iterandseed; signature kept stableopenquant::labeling::get_events(8)get_eventssignaturepyopenquant::helpers::build_ohlcv_columns(8)OhlcvColumns; a params struct would duplicate that typepyopenquant#[pyfunction]s:cla_allocate,data_clean_ohlcv,data_quality_report,data_align_calendar,hcaa_allocate,labeling_triple_barrier_events,labeling_triple_barrier_labels,labeling_meta_labels,labeling_get_events,pipeline_run_mid_frequency_pipeline,portfolio_allocate_with_solution,sb_fit_predict_classifier,sb_fit_predict_regressor,sr_estimate_strategy_failure_probability,sbt_generate_ou_paths,sbt_run_synthetic_otr_workflow,sbt_search_optimal_trading_rule(17)#[allow(clippy::unnecessary_to_owned)]:MicrostructuralFeaturesGenerator::new_from_csv,tick_num_iterfield initvec::IntoIter<usize>); clippy's borrowed-iterator suggestion would add a lifetime to a public typeNotable hand fixes
needless_range_loop: rewritten withiter_mut().enumerate()/.take().skip(); iteration order and float accumulation order are unchanged.sampling::num_concurrent_eventsdeliberately uses.take(end+1).skip(start)rather than a slice sostart > end_idxstays a no-op instead of becoming a panic.manual_clampinbet_sizing::discrete_signal:f64::clamp(-1.0, 1.0)matches the old if-chain, including NaN pass-through.large_enum_variant: privateetf_trick::Source::InMemorynow holds aBox<InMemoryTables>.too_many_arguments: private-to-the-crate helperpyopenquant::helpers::build_labeling_eventstakes a newLabelingEventArgsstruct.bet_sizing::{ReserveBetSizeRow, MixtureParams},cross_validation::TrainTestSplit.Test files
No expected value, tolerance or fixture changed, and no test was removed or ignored. However,
--all-targets -D warningsalso lints tests, soclippy --fixmade semantically identical rewrites inside some test assertions, e.g.assert!(b >= -1.0 && b <= 1.0)->assert!((-1.0..=1.0).contains(&b)),matches!(bin, -1 | 0 | 1)->matches!(bin, -1..=1),pca[0].len() >= 1->!pca[0].is_empty(), inlined format args in assertion messages,vec![..]->[..]for two literal lists (same values). Please reviewcrates/openquant/tests/with that in mind.CI alignment
ci.yml,release.ymlandjustfilenow all run exactly:The
clippy.tomlcomment quotes that command (now true);docs/publishing.mdand the docs-site local-build page were updated to match.Caveat: workflows use
dtolnay/rust-toolchain@stable(unpinned), and this was verified locally on clippy 1.88.0 only. A newer stable clippy may have additional lints; CI on this PR is the check for that.Commands run (local, rustc/clippy 1.88.0)
cargo clippy --fix --workspace --all-targets --all-features --allow-dirtycargo clippy --workspace --all-targets --all-features -- -D warningsFinished dev profile, exit 0cargo test --workspace#[ignore]ontest_sadf_testis untouched)cargo fmt --checkNot run: Python bindings build (maturin) / Python tests, docs-site API-drift gate, benches (compiled under clippy only).
Observed but intentionally not changed
MicrostructuralFeaturesGenerator::new_from_csvseedscurrent_bar_tickfromtick_num_series.first()but the iterator is not advanced, so the first threshold appears to be consumed twice inget_features. Looks like a possible porting bug vs. mlfinlab's generator; behaviour left as is.🤖 Generated with Claude Code