Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Visual studio code 带VScode的phpcs-如何禁用测线长度警告?_Visual Studio Code_Phpcs - Fatal编程技术网

Visual studio code 带VScode的phpcs-如何禁用测线长度警告?

Visual studio code 带VScode的phpcs-如何禁用测线长度警告?,visual-studio-code,phpcs,Visual Studio Code,Phpcs,我正在处理一些遗留代码,VScode突出显示了很多行,因为出现了一些警告,如行超过85个字符,包含91个字符。这很烦人,我想把这个限制提高到至少120个字符,甚至完全禁用它。 我的直尺已经设置为120 我如何移动或取消该限制?我到处找,但找不到有效的答案。。。这是我的项目的settings.json { "editor.wordWrapColumn": 120 } 在VS代码中编辑phpcs设置,并确保“PHP嗅探器:标准”为空(以便它查找自定义规则集文件) 在项目根目录中创建文件“p

我正在处理一些遗留代码,VScode突出显示了很多行,因为出现了一些警告,如
行超过85个字符,包含91个字符。这很烦人,我想把这个限制提高到至少120个字符,甚至完全禁用它。
我的直尺已经设置为120

我如何移动或取消该限制?我到处找,但找不到有效的答案。。。这是我的项目的
settings.json

{
    "editor.wordWrapColumn": 120
}

在VS代码中编辑phpcs设置,并确保“PHP嗅探器:标准”为空(以便它查找自定义规则集文件)

在项目根目录中创建文件“phpcs.xml”,其中包含如下规则集:

<?xml version="1.0"?>
<ruleset name="MyRuleset">
  <!-- Scan all files in directory -->
  <file>.</file>

  <!-- Ignore Composer dependencies -->
  <exclude-pattern>vendor/</exclude-pattern>

  <!-- Show colors in console -->
  <arg value="-colors"/>

  <!-- Show sniff codes in all reports -->
  <arg value="ns"/>

  <!-- Use PSR-12 as a base -->
  <rule ref="PSR12"/>

  <rule ref="Generic.Files.LineLength.TooLong">
      <severity>0</severity>
  </rule>
</ruleset>

.
卖主/
0

通过将警告严重性设置为6,我已经部分解决了这个问题。。。至少我不再有这些警告了。您是如何将警告严重性设置为6的?在settings.json中添加
“phpcs.warningSeverity”:6
对我不起作用。我得到错误
phpcs:c:\Users\paul\OneDrive\Games\Scratch\Shops\PP\Site\phpcs.xml“编码标准未安装。请检查您的配置,然后重试。