Skip to content

Commit

Permalink
chore: update deno_path_util (#684)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret authored Dec 27, 2024
1 parent 2c0ff7c commit 3fe2842
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 38 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,18 @@ jobs:
if: contains(matrix.os, 'ubuntu')
run: cd js && deno run -A jsr:@david/[email protected] --allow-dirty

- name: Install cargo-llvm-cov
if: contains(matrix.os, 'ubuntu')
uses: taiki-e/install-action@cargo-llvm-cov

- name: Generate code coverage
if: contains(matrix.os, 'ubuntu')
run: cargo llvm-cov --lcov --output-path lcov.info

- name: Upload coverage to Codecov
if: contains(matrix.os, 'ubuntu')
uses: codecov/codecov-action@v3
with:
files: lcov.info
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
# - name: Install cargo-llvm-cov
# if: contains(matrix.os, 'ubuntu')
# uses: taiki-e/install-action@cargo-llvm-cov

# - name: Generate code coverage
# if: contains(matrix.os, 'ubuntu')
# run: cargo llvm-cov --lcov --output-path lcov.info

# - name: Upload coverage to Codecov
# if: contains(matrix.os, 'ubuntu')
# uses: codecov/codecov-action@v3
# with:
# files: lcov.info
# fail_ci_if_error: true
# token: ${{ secrets.CODECOV_TOKEN }}
85 changes: 78 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repository = "https://github.com/denoland/deno_doc"
members = ["lib"]

[workspace.dependencies]
deno_graph = { version = "0.86.3", default-features = false, features = ["symbols"] }
deno_graph = { version = "0.86.6", default-features = false, features = ["symbols"] }
deno_ast = { version = "0.44.0" }
import_map = "0.20.0"
serde = { version = "1.0.204", features = ["derive"] }
Expand All @@ -38,7 +38,7 @@ serde.workspace = true
serde_json = { version = "1.0.122", features = ["preserve_order"] }
termcolor = "1.4.1"
itoa = "1.0.14"
deno_path_util = "0.2.1"
deno_path_util = "0.3.0"

html-escape = { version = "0.2.13" }
handlebars = { version = "6.1", features = ["string_helpers"] }
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.80.0"
channel = "1.83.0"
components = ["rustfmt", "clippy"]
2 changes: 1 addition & 1 deletion src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ struct DiagnosticDocNodeVisitor<'a, 'b> {
diagnostics: &'a mut DiagnosticsCollector<'b>,
}

impl<'a, 'b> DiagnosticDocNodeVisitor<'a, 'b> {
impl DiagnosticDocNodeVisitor<'_, '_> {
pub fn visit_doc_nodes<'c, I>(&'c mut self, doc_nodes: I)
where
I: Iterator<Item = &'c DocNode>,
Expand Down
2 changes: 1 addition & 1 deletion src/html/comrak.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub fn strip(md: &str) -> String {
output.write_all(literal.as_bytes()).unwrap();
}
NodeValue::LineBreak | NodeValue::SoftBreak => {
output.write_all(&[b' ']).unwrap()
output.write_all(b" ").unwrap()
}
_ => {
for n in node.children() {
Expand Down
4 changes: 2 additions & 2 deletions src/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub struct DocPrinter<'a> {
private: bool,
}

impl<'a> DocPrinter<'a> {
impl DocPrinter<'_> {
pub fn new(
doc_nodes: &[DocNode],
use_color: bool,
Expand Down Expand Up @@ -766,7 +766,7 @@ impl<'a> DocPrinter<'a> {
}
}

impl<'a> Display for DocPrinter<'a> {
impl Display for DocPrinter<'_> {
fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult {
self.format(f)
}
Expand Down
18 changes: 9 additions & 9 deletions src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,45 +627,45 @@ export namespace Deno {
// Namespace
let found = find_nodes_by_name_recursively(entries.clone(), "Deno");
assert_eq!(found.len(), 1);
assert_eq!(found[0].name, "Deno".into());
assert_eq!(found[0].name.as_ref(), "Deno");

// Overloaded functions
let found = find_nodes_by_name_recursively(entries.clone(), "Deno.test");
assert_eq!(found.len(), 3);
assert_eq!(found[0].name, "test".into());
assert_eq!(found[1].name, "test".into());
assert_eq!(found[2].name, "test".into());
assert_eq!(found[0].name.as_ref(), "test");
assert_eq!(found[1].name.as_ref(), "test");
assert_eq!(found[2].name.as_ref(), "test");

// Nested namespace
let found = find_nodes_by_name_recursively(entries.clone(), "Deno.Inner.a");
assert_eq!(found.len(), 1);
assert_eq!(found[0].name, "a".into());
assert_eq!(found[0].name.as_ref(), "a");

// Interface property
let found = find_nodes_by_name_recursively(entries.clone(), "Deno.Conn.rid");
assert_eq!(found.len(), 1);
assert_eq!(found[0].name, "rid".into());
assert_eq!(found[0].name.as_ref(), "rid");
assert_eq!(found[0].kind(), DocNodeKind::Variable);

// Interface method
let found =
find_nodes_by_name_recursively(entries.clone(), "Deno.Conn.closeWrite");
assert_eq!(found.len(), 1);
assert_eq!(found[0].name, "closeWrite".into());
assert_eq!(found[0].name.as_ref(), "closeWrite");
assert_eq!(found[0].kind(), DocNodeKind::Function);

// Class property
let found =
find_nodes_by_name_recursively(entries.clone(), "Deno.Process.pid");
assert_eq!(found.len(), 1);
assert_eq!(found[0].name, "pid".into());
assert_eq!(found[0].name.as_ref(), "pid");
assert_eq!(found[0].kind(), DocNodeKind::Variable);

// Class method
let found =
find_nodes_by_name_recursively(entries.clone(), "Deno.Process.output");
assert_eq!(found.len(), 1);
assert_eq!(found[0].name, "output".into());
assert_eq!(found[0].name.as_ref(), "output");
assert_eq!(found[0].kind(), DocNodeKind::Function);

// No match
Expand Down

0 comments on commit 3fe2842

Please sign in to comment.