Repository navigation
build(deps): Bump all dependencies to their latest versions - #1253
Conversation
935008a to
400d116
Compare
(#6) tree-sitter 0.27 recovers differently from the missing semicolon after the `__Pyx_PyThreadState_declare` macro in pywrapfst.cc: it is now parsed as an expression statement, which counts as a logical line of code.
Notable updates: tree-sitter 0.27.2, tree-sitter-rust 0.24.2, askama 0.16, toml 1.2, num-derive 0.5. tree-sitter 0.27 changed `Node::kind` to return a `&'tree str` instead of `&'static str`, and `Node::child_count` to return `u32`. Our `Node::child_count` and `Node::child` wrappers now use `u32` too, matching tree-sitter, instead of converting to and from `usize`. Since `AstNode` stores its type as `&'static str`, `Alterator` now resolves node kinds through the generated language enums, which map each kind id to a `&'static str`. A test checks that this mapping matches tree-sitter's names for every kind id of every supported language.
400d116 to
9cfa4ce
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1253 +/- ##
===========================================
+ Coverage 70.34% 90.43% +20.08%
===========================================
Files 62 62
Lines 16414 16438 +24
===========================================
+ Hits 11547 14866 +3319
+ Misses 4867 1572 -3295 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Regenerate tree-sitter-mozcpp, tree-sitter-mozjs, tree-sitter-preproc and tree-sitter-ccomment with tree-sitter-cli 0.27.2, and bump the grammar crate versions accordingly. The generated parsers now use ABI 15, since tree-sitter-cli 0.27 no longer requires a tree-sitter.json for it.
tree-sitter 0.27 recovers differently from a missing semicolon after a macro used as a statement in DeepSpeech's pywrapfst.cc, which changes its LOC metric (mozilla/rust-code-analysis-output#6).
9cfa4ce to
b9ce53a
Compare
|
I looked at the differences reported by the grammar check tasks for this PR (https://community-tc.services.mozilla.com/tasks/groups/VF3vy5QbQ7G3-7Pp57HjVQ). Java, Kotlin, Python and TypeScript weren't checked, since their grammars didn't change. For mozjs (29 files), mozcpp (215) and Rust (63):
Rust's With #1263, all the 307 files with differences pass basic consistency checks on the new metrics: the root spans the whole file, spaces are nested in their parents, LOC values are consistent, and nothing is negative. |
Follow-up to #1225: bumps every dependency in the workspace (and the non-member
enumscrate) to its latest release.Dependency updates
Version-requirement floors were also raised to the current releases for aho-corasick, regex, termcolor, walkdir, pretty_assertions, clap, actix-rt, actix-web and cc. All other tree-sitter grammar crates (java, typescript, javascript, python, cpp, kotlin-sg) are already at their latest releases.
Code changes
tree-sitter 0.27 changed two
NodeAPIs:Node::child_countnow returnsu32. OurNode::child_countandNode::childwrappers now useu32too, matching tree-sitter, instead of converting to and fromusize. The onlyusizeconversion left is where the count is used as aVeccapacity.Node::kindnow returns&'tree strinstead of&'static str.AstNodestores its type as a public&'static str, so instead of changing that public API,Alteratornow resolves the kind through the generated language enums (LanguageInfo::BaseLang), which already map every kind id to a&'static str.LanguageInfo::BaseLanggains aFrom<u16> + Into<&'static str>bound, which every generated enum satisfies.A new test,
alterator::tests::kind_names_match_tree_sitter, checks that this mapping matchesLanguage::node_kind_for_idfor every kind id (plusERROR) of every supported language. That also guards against the generated enums going stale after a future grammar bump.Grammars
tree-sitter-mozcpp,tree-sitter-mozjs,tree-sitter-preprocandtree-sitter-ccommentwere regenerated with tree-sitter-cli 0.27.2 from the same upstream sources as build(deps): Update tree-sitter to 0.26.5 and all grammar dependencies #1225. The generated parsers move from ABI 14 to ABI 15, since tree-sitter-cli 0.27 no longer needs atree-sitter.jsonfor it. Crate versions stay at the unpublished 0.20.4 / 0.20.5 from build(deps): Update tree-sitter to 0.26.5 and all grammar dependencies #1225.src/languages/language_rust.rswas regenerated for tree-sitter-rust 0.24.2.tree-sitter 0.27 raises the MSRV to Rust 1.90. CI uses
rust:bookworm, so that's fine.Snapshot changes
tree-sitter 0.27 recovers differently from a missing semicolon after a macro used as a statement (
__Pyx_PyThreadState_declarein DeepSpeech'spywrapfst.cc): it is now parsed as anexpression_statementinstead of a lonetype_identifier, so it counts as a logical line. This changesllocfor one function (22 → 23) in both copies of the file. The snapshots were updated in mozilla/rust-code-analysis-output#6, and this PR bumps thetests/repositories/rca-outputsubmodule accordingly.Test plan
cargo test --workspace, including the DeepSpeech, pdf.js and serde repository tests: 299 passedcargo clippy --workspace --all-targets -- -D warningscargo fmt --all -- --check