Skip to content

Add more shell builtins and POSIX utilities to the ignored global binaries - #2277

Merged
webpro merged 1 commit into
webpro-nl:mainfrom
SwastikTripathi:fix/ignore-shell-builtins
Nov 2, 2026
Merged

webpro merged 1 commit into
webpro-nl:mainfrom
SwastikTripathi:fix/ignore-shell-builtins

Conversation

@SwastikTripathi

@SwastikTripathi SwastikTripathi commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Scripts using shell builtins or standard utilities like ulimit, tail, unset or mktemp get them reported as unlisted binaries. I found this running knip over opencode, whose dev:console script starts with ulimit -n 10240.

Added these to IGNORED_GLOBAL_BINARIES: alias, bg, bind, break, builtin, chgrp, cmp, continue, dd, declare, du, eval, fg, getopts, gunzip, hash, hostname, jobs, killall, local, mktemp, pgrep, pkill, read, readlink, realpath, return, shift, tail, type, ulimit, umask, unalias, unset, wait.

I ran a package with one script per command: all of them were reported before this and none are now, and ulimit is gone from the report on opencode. No new test, same as earlier additions to this list (#2182, #1972). The binary and script input tests pass.

…aries

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pkg-pr-new

pkg-pr-new Bot commented Nov 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/knip@2277
npm i https://pkg.pr.new/@knip/language-server@2277
npm i https://pkg.pr.new/@knip/mcp@2277

commit: 6cd4038

@webpro webpro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! All 35 additions stop being reported, and an installed package that provides one of these names still counts as used. Noting for later: realpath and wait don't meet the npm criteria in the comment at the top of this list, as both are packages published in the last six years with a matching bin and about 7,200 weekly downloads. The shell meaning is far more common, so they're fine to keep.

@webpro
webpro merged commit 7a89dec into webpro-nl:main Nov 2, 2026
32 checks passed
@webpro

webpro commented Nov 3, 2026

Copy link
Copy Markdown
Member

πŸš€ This pull request is included in v6.44.2. See Release 6.44.2 for release notes.

Using Knip in a commercial project? Please consider becoming a sponsor.

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.

2 participants