Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save gh640/c9c69a0d467f6cac8811 to your computer and use it in GitHub Desktop.

Select an option

Save gh640/c9c69a0d467f6cac8811 to your computer and use it in GitHub Desktop.
PHP Code Sniffer を日本語でも快適に使うための Drupal コーディングスタンダードファイルの修正箇所

LineLengthSniff.php:

// changed for Japanese text.
// public $lineLimit = 80;
public $lineLimit = 500;

FunctionCommentSniff.php:

// comment out for Japanese comment.
// if (preg_match('|[A-Z]|', $testShort[0]) === 0) {
//     $error = 'Function comment short description must start with a capital letter';
//     $phpcsFile->addError($error, ($commentStart + 1), 'ShortNotCapital');
// }

// comment out for Japanese comment.
// if ($lastChar !== '.') {
//     $error = 'Function comment short description must end with a full stop';
//     $phpcsFile->addError($error, ($commentStart + 1), 'ShortFullStop');
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment