Proposal: Add Feature To Ignore Specific Checks Using Comments

オープン
#1,154 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
php
領域
tooling

調査の方向性

リポジトリのファイル、テスト、エントリポイントは指定されていません。まず Plugin Check がエラーと警告を報告する仕組みを追跡し、次に提案されている PHP コメントアノテーションを既存の結果表示と比較してください。選択したチェックを非表示にしつつ、他の検出結果は表示したままにできれば完了です。

索引モデルが issue の本文から書いたものです。

説明

The plugin check plugin is a great tool. It has helped developers like me make their code compliant with the WordPress guidelines. However, some errors and warnings detected by this tool fall under the false positive category.

Similar toos like PHP Mess Detector and PHPStan have a way of supressing errors, using comments like

$test = new Test();

// @phpstan-ignore-next-line
$test->magic_property = 'magic value';

for PHPStan
or

/**
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
function test( $a , $b, $c ) {
    ...
}

for PHP Mess Detector

Proposal

I would be great if there is a way to supress the errors and warnings the developer thinks are false positives from showing as these could sometimes overcrowd the results page, making it difficult to spot other errors. Supressing this errors will enable the developer to focus on solving the most pertinent issues as these errors will be hidden from the results page.

I am proposing adding a feature to hide some errors and warnings.
For example

public function check_nonce() {
    ...
}

/**
* @PluginCheckSuppress(WordPress.Security.NonceVerification.Recommended)
*/
function some_function_here() {
    // Already checked for the nonce in the check_nonce() function
    // codes here ...
}

Please let me know what you think.

主要言語
PHP
スター
365
フォーク
135
平均マージ
1日 8時間
マージ済み PR(30日)
20

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

WordPress/plugin-check のほかの issue

WordPress/plugin-check の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。