Reducing command line args required for running PHPCS

When you run JSHint, the only thing you need to put on the command line is: jshint. No additional arguments are required to check JS files under the current directory, and it automatically looks for a .jshintrc file for its configuration. For years now when I’ve wanted to similarly run PHP_CodeSniffer to check the adherence of some PHP code against coding standards, … Continue reading Reducing command line args required for running PHPCS

Referring to the Previous Git Commit

On the command line shell, there is a magic symbol “-” (hyphen). When dealing with streams, it can refer to STDIN or STDOUT. When used in the context of the cd command, the – refers to the previous directory (it is the same as $OLDPWD). So you can switch between two directories by repeatedly entering … Continue reading Referring to the Previous Git Commit

PHP Code Beautifier and Fixer (phpcbf)

All of us PHP developers should be very well familiar with WordPress Coding Standards for PHP_CodeSniffer (phpcs). It automatically finds problems in WordPress code, both in terms of code style but also in terms of performance and security. It should be configured in your IDE and called in your repos’ pre-commit hooks. Did you also … Continue reading PHP Code Beautifier and Fixer (phpcbf)