question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Different phpcs.standard settings for different folders in same workspace are not taken into consideration

See original GitHub issue

I have a workspace where I have four folders in. Three of the folders are WordPress related and therefore should be treated with the WordPress-Extra standards definition. The last one is a framework agnostic module that should be treated with the PSR2 standards.

Now it looks as if the standard used is the one in the .vscode/settings.json of the first file that’s loaded and not the one for the folder (order the overall workspace settings one) if it’s not present.

PHP_CodeSniffer is installed in version 2.9.1 PHP is 7.1.14 VS Code is 1.20.1 phpcs Plugin Version is 0.7.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ikappascommented, Feb 21, 2018

I just released vscode-phpcs 1.0.0 which supports the VSCode 1.20+ and includes many enhancements most notable of which are:

  1. multi root support
  2. lint as you type support
  3. automatic configuration search support
  4. ability to set phpcs.executablePath
  5. ability to set phpcs.showWarnings
  6. ability to set phpcs.showSources
  7. ability to set phpcs.composerJsonPath to something other that workspaceRoot/composer.json
  8. ability to enable phpcs.trace.server with messages or verbose option for tracing errors.

I would like to give my thanks to all the people that helped track down issues in the previous betas and hope the new features help you get things done easier.

On that note, I am closing this issue to properly track any new issues in the new release. If you find this issue persists or any other issue please feel free to open a new ticket for v.1.0.0.

1reaction
ikappascommented, Feb 17, 2018

I just pushed multi-root support in develop branch that needs testing

Read more comments on GitHub >

github_iconTop Results From Across the Web

PHPCS different ruleset for different directories - Stack Overflow
I'd like to modify it so that PSR-2 is applied to certain directories (e.g. foo/ and bar/ ) while the remaining directories are...
Read more >
Configure PHP_CodeSniffer and Visual Studio Code to ...
In this article I'll try to show you how to setup a development environment for a WordPress plugin that follows the WordPress coding...
Read more >
Installing Coder Sniffer | Code Review Module - Drupal
Coder contains "sniffs" for PHP CodeSniffer. These "sniffs" tell PHP CodeSniffer whether the code meets Drupal coding standards or not.
Read more >
Setting Up PHP CodeSniffer Per Project | Tom McFarlin
Here's how you can start setting up PHP CodeSniffer per project using Composer, Visual Studio Code, and various coding standards.
Read more >
Static Application Security Testing (SAST) - GitLab Docs
The Security Scanner Integration documentation explains how to integrate other security scanners into GitLab. Configuration. To configure SAST for a project you ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found