Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Review use of external sniffs

未关闭
#553 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
20/100
Issue 类型
重构
描述清晰度
需要澄清
活跃度
停滞
技术栈
php
领域
tooling

调研方向

从此 issue 中的外部 sniff 列表开始,并从 Generic、PSR2、Squiz、VariableAnalysis 或 WordPress rulesets 中选择一个 sniff。根据两个 VIPCS rulesets 和 upstream 项目信息,审查其当前的相关性、行为、替代方案以及已报告或可观察到的问题。完成的标准是每个 sniff 都有一份记录在案的审查,并在需要后续工作时分别创建有针对性的 issue。

由索引模型根据 Issue 内容生成。

描述

Both VIPCS rulesets currently use the following external sniffs:

Generic (5 sniffs)
------------------
  Generic.NamingConventions.ConstructorName
  Generic.PHP.DisallowShortOpenTag
  Generic.PHP.NoSilencedErrors
  Generic.PHP.Syntax
  Generic.VersionControl.GitMergeConflict

PSR2 (1 sniff)
---------------
  PSR2.Files.ClosingTag

Squiz (3 sniffs)
----------------
  Squiz.PHP.CommentedOutCode
  Squiz.PHP.Eval
  Squiz.WhiteSpace.SuperfluousWhitespace

VariableAnalysis (1 sniff)
---------------------------
  VariableAnalysis.CodeAnalysis.VariableAnalysis

WordPress (20 sniffs)
---------------------
  WordPress.CodeAnalysis.AssignmentInCondition
  WordPress.DB.DirectDatabaseQuery
  WordPress.DB.PreparedSQL
  WordPress.DB.SlowDBQuery
  WordPress.DateTime.RestrictedFunctions
  WordPress.PHP.DevelopmentFunctions
  WordPress.PHP.DiscouragedPHPFunctions
  WordPress.PHP.DontExtract
  WordPress.PHP.IniSet
  WordPress.PHP.StrictComparisons
  WordPress.PHP.StrictInArray
  WordPress.Security.EscapeOutput
  WordPress.Security.NonceVerification
  WordPress.Security.PluginMenuSlug
  WordPress.Security.ValidatedSanitizedInput
  WordPress.WP.AlternativeFunctions
  WordPress.WP.CronInterval
  WordPress.WP.EnqueuedResources
  WordPress.WP.GlobalVariablesOverride
  WordPress.WP.PostsPerPage

For each of these sniffs, a review should be done to verify the following:

  • Is the sniff still relevant ?
  • Does the sniff do what it should do ?
  • Is this still the best sniff for the job or have other sniffs been published in the mean time which are better, i.e. should the current sniff inclusion be replaced with another sniff ?
  • Are there known issues with the sniff, either reported here or upstream ? And if so, can we contribute to fixing these ?
  • Are there unreported issues with the sniff based on a quick code review ? Things along the same lines as the VIPCS native sniffs are being reviewed for, like code style independence and correct handling of modern PHP code.

I'm opening this issue as a placeholder/reminder that this review needs to be done. When the time is right to address this, we may need to open individual issues for each sniff to allow for a more targeted discussion of each sniff.

主要语言
PHP
星标
261
派生
44
平均合并
3 天 17 小时
30 天内合并 PR
9

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Automattic/VIP-Coding-Standards 的其他 Issue

查看 Automattic/VIP-Coding-Standards 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。