-
QuestionPHPCS generally takes a specific coding standard (Drupal, PSR2 etc) for sniffs. It is not clear to me how to specify this to the plugin, or what standards are available. How to reproduce (optional)Expected behavior (optional)No response CLI Versionqlty 0.485.0 linux-x64 (fd779b6 2025-02-07) Information about Qlty configuration and environment (optional)config_version = "0"
exclude_patterns = [
"cypress/",
"config/",
"db/",
"dist/",
"docs/",
"documentation/",
"features/",
"**/node_modules/",
"script/",
"**/spec/",
"**/test/",
"**/tests/",
"Tests/",
"**/vendor/",
"**/*_test.go",
"**/*.d.ts",
"**/*.yml",
"**/*.json",
"**/*.js",
"**/*.jsx",
"*.md",
"**/*.md",
"*.install",
"*.profile",
"*.module",
"*.xml",
"**/*.xml",
"**/*.install",
"**/*.profile",
"**/*.module",
".circleci/",
".gitignore",
]
test_patterns = [
"**/test/**",
"**/tests/**",
"**/Tests/**",
]
[smells]
mode = "block"
[[source]]
name = "default"
default = true
[[plugin]]
name = "bandit"
version = "1.7.9"
[[plugin]]
name = "checkov"
[[plugin]]
name = "golangci-lint"
[[plugin]]
name = "markdownlint"
version = "0.41.0"
[[plugin]]
name = "osv-scanner"
[[plugin]]
name = "php-codesniffer"
[[plugin]]
name = "phpstan"
[[plugin]]
name = "prettier"
[[plugin]]
name = "ripgrep"
[[plugin]]
name = "ruff"
version = "0.5.3"
[[plugin]]
name = "trivy"
drivers = [
"config",
"fs-vuln",
]
[[plugin]]
name = "trufflehog"
[[plugin]]
name = "yamllint"
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
@dafeder thanks for this report. How is this typically done with PHPCS when you run it without the Qlty CLI? Are the rule sets specified as command line arguments or a configuration file, for example? Since the Qlty CLI is executing PHPCS under the hood, anything that PHPCS supports would be supported when running PHPCS via the Qlty CLI. You can take a look at what it is doing with a command like this: qlty check --filter=php-codesniffer --no-cache --no-fix --debug --verbose --all At the bottom of the output you will see a list of JOBS. For each job, there will be a Debug File like |
Beta Was this translation helpful? Give feedback.
OK what I should have tried first was just putting phpcs.xml in the project root - seeing the cwd property in the output file made it click that even though it's targeting specific files from the diff, having the xml file in the project root works. I think this is fine, maybe should just be included in the documentation for using with php projects (which is see is still a WIP). It also reflects changes when I make them (probably not a surprise).
Now a new problem: It only has the built-in standards that come with PHPCS out of the box. In codeclimate, a number of additional standards were supported. For my project I would need some way to at least pull in Drupal and DrupalPractice to swap …