How to add additional Coding Standards to php-codesniffer and other PHP tools #2254
Unanswered
jacobsantos
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
I looked at https://github.com/orgs/qltysh/discussions/1499 and it does not resolve the issue. Adding the composer.json to the Snippet from [[plugin]]
name = "php-codesniffer"
mode = "comment"
package_file = ".qlty/configs/composer.json"
{
"require": {
"slevomat/coding-standard": "~8.0",
"larastan/larastan": "^2.0"
},
"config": {
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Question
I am trying to use
slevomat/coding-standardwith php-codesniffer library. I get the following error when I run theqlty checkcommand locally:ERROR: Referenced sniff "SlevomatCodingStandard.Namespaces.UnusedUses" does not existThis also occurs with other PHP tools where there might be additional vendor dependencies. I tried using
extra_packages. The problem is that some code exists in the same repository and the config sandbox is not picking up the files. Using relative paths also does not work.With PHPStan to include Laravel extensions does not work.
I tried symlinking the files in the
.qlty/configsdirectory, but that was also a no-go.What am I doing wrong and what can I do to allow these tools to work with custom or third-party extensions?
How to reproduce (optional)
phpcs.xmlconfigurationvendor/bin/phpcs srcqlty checkExpected behavior (optional)
qlty checkshould complete and show the same sniff failures asvendor/bin/phpcs srcCLI Version
qlty 0.557.0 macos-arm64 (5904892 2025-07-22)
Information about Qlty configuration and environment (optional)
Beta Was this translation helpful? Give feedback.
All reactions