• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (inactive)
You are here: Home / Dev Tips / phpcs no matches found ignore

phpcs no matches found ignore

Last updated on March 13, 2023 by Sal Ferrarello

When running phpcs with the --ignore option (because I don’t want to scan the /vendor nor /node_modules directories), I kept getting the error zsh: no matches found: --ignore=/vendor/*,/node_modules/*.

The problem is zsh tries to expand (a.k.a. glob) the command based on the asterisk (*).

phpcs -p --ignore=/vendor/*,/node_modules/* .

zsh: no matches found: --ignore=/vendor/*,/node_modules/*

Solutions

Solution 1: Quotes

By adding quotes around the ignore value, we can prevent the zsh globbing.

phpcs -p --ignore='/vendor/*,/node_modules/*' .

Solution 2: noglob

Zsh also includes precommand modifiers, one of which is noglob which disables globbing for the following command.

noglob phpcs -p --ignore=/vendor/*,/node_modules/* .
Sal Ferrarello
Sal Ferrarello (@salcode)
Sal is a PHP developer with a focus on the WordPress platform. He is a conference speaker with a background including Piano Player, Radio DJ, Magician/Juggler, Beach Photographer, and High School Math Teacher. Sal can be found professionally at WebDevStudios, where he works as a senior backend engineer.

Share this post:

Share on TwitterShare on FacebookShare on LinkedInShare on EmailShare on Reddit

Filed Under: Computing, Dev Tips, Programming, Solution Tagged With: PHPCS, zsh

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2023 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in