Skip to content

feat(rules): classify npm download cache - #130

Merged
Muawiya-contact merged 3 commits into
mainfrom
codex/add-npm-cache-rule
Sep 12, 2026
Merged

feat(rules): classify npm download cache#130
Muawiya-contact merged 3 commits into
mainfrom
codex/add-npm-cache-rule

Conversation

@Muawiya-contact

@Muawiya-contact Muawiya-contact commented Sep 12, 2026

Copy link
Copy Markdown
Member

Closes #71.

What changed

  • Added one rules-database entry for npm's download cache.
  • Covers Unix/macOS npm cache files under ~/.npm/_cacache and Windows cache files under AppData\\Local\\npm-cache.
  • Added tests for cache paths that should be safe and nearby npm state that should stay unknown.
  • Added a changelog note.

Rule added:

{
  "id": "npm-cache",
  "patterns": ["**/.npm/_cacache/**", "**/appdata/local/npm-cache/**"],
  "category": "package_manager_cache",
  "verdict": "safe",
  "description": "npm's download cache. Re-fetched on demand; removing it only makes the next install download packages again."
}

Commits

  • feat(rules): add npm cache rule
  • test(rules): cover npm cache matching
  • docs(changelog): note npm cache rule

Validation

cargo fmt --check
cargo test -p diskern-core --all-features npm
cargo test -p diskern-core -p diskern-cli --all-features
cargo clippy -p diskern-core -p diskern-cli --all-targets --all-features -- -D warnings

@Muawiya-contact Muawiya-contact left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@Muawiya-contact
Muawiya-contact merged commit f24d89c into main Sep 12, 2026
12 checks passed
@Muawiya-contact
Muawiya-contact deleted the codex/add-npm-cache-rule branch September 12, 2026 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rules wanted: teach Diskern about the caches on your platform

1 participant