Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
mysteryven committed Aug 14, 2024
1 parent 8ccd68e commit 332b31d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 113 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
# cache `target` directory to avoid download crates
save-cache: ${{ github.ref_name == 'main' }}
cache-key: warm
- run: cargo ck
- run: cargo test --no-run
- run: cargo test
- run: git diff --exit-code # Must commit everything
Expand Down Expand Up @@ -116,7 +115,7 @@ jobs:
with:
cache-key: warm
components: clippy
- run: cargo lint -- -D warnings
- run: cargo clippy -- -D warnings

doc:
name: Doc
Expand Down
106 changes: 10 additions & 96 deletions Cargo.lock

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

4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@ edition = "2021"

[dependencies]
bpaf = { version = "0.9.12", features = ["derive"] }
colored = "2.1.0"
colorful = "0.3.2"
compact_str = { version = "0.8.0", features = ["serde"] }
fxhash = "0.2.1"
ignore = "0.4.22"
once_cell = "1.19.0"
oxc_allocator = "0.24.1"
oxc_ast = "0.24.1"
oxc_parser = "0.24.1"
oxc_semantic = "0.24.1"
oxc_span = { version = "0.24.1", features = ["serialize"] }
oxc_syntax = "0.24.1"
rayon = "1.10.0"
serde = { version = "1.0.205", features = ["derive"] }
serde_json = "1.0.122"
5 changes: 1 addition & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ impl DepClean {
}

let dep_text = if unused_deps.len() > 1 {
let title = format!(
"Found {} unused dependencies:\n",
unused_deps.len(),
);
let title = format!("Found {} unused dependencies:\n", unused_deps.len(),);
let body = unused_deps
.iter()
.map(|dep| format!(" - {}", dep))
Expand Down
14 changes: 7 additions & 7 deletions src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ impl<'a> DepCheckerContext<'a> {
}

/// Add a dependency to the used dependencies set if it was used in current file.
///
///
/// In the below example, `A` and `c` is used, `B` is unused.
/// ```js
/// import A from 'a';
/// import B from 'b';
///
///
/// console.log(A)
///
///
/// export * as C from 'c';
/// ```
pub fn add_use(&self, name: CompactStr) {
Expand All @@ -74,18 +74,18 @@ impl Runtime {
}

/// # Panics
///
///
/// If the file extension is not one of "js", "mjs", "cjs", "jsx", "ts", "mts", "cts", "tsx"
///
/// Analyze their esm and cjs dependencies, return the used dependencies
/// for file:
///
/// for file:
///
/// ```js
/// import A from './a.js';
/// import B from 'b/foo.mjs';
/// const C = require('c')
/// ```
///
///
/// We will get `["b/foo.mjs", "c"]`
pub fn check_js_files(&self, path: &Path) -> Vec<CompactStr> {
let Ok(source_type) = SourceType::from_path(path) else {
Expand Down
1 change: 1 addition & 0 deletions tests/test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use depclean::DepClean;

#[ignore]
#[test]
fn test_simple() {
let root_path = std::env::current_dir().unwrap().join("tests/fixtures");
Expand Down

0 comments on commit 332b31d

Please sign in to comment.