SublimeLinter / SublimeLinter-phpcs

SublimeLinter plugin for PHP, using phpcs.
MIT License
71 stars 15 forks source link

Errors don't show #46

Closed p4scu41 closed 5 years ago

p4scu41 commented 5 years ago

When I run Lint this view the errors don't show, just show the warnings, but if I run phpcs in command line it shows all errors. I activated the debug mode but nothing shows in the console.

image

image

image

image

PHP_CodeSniffer version 3.4.2 (stable) by Squiz (http://www.squiz.net)

// SublimeLinter Settings - User
{
    "linters": {
        "php": {
            "disable": false,
            "args": "-l",
            "executable": "/usr/bin/php",
            "lint_mode": "save",
            "selector": "source.php"
        },
        "phpcs": {
            "disable": false,
            "filter_errors": [],
            "args": "--standard=PSR2",
            "executable": "/home/usuario/.config/composer/vendor/bin/phpcs",
            "lint_mode": "save",
            "selector": "source.php"
        },
        "phpmd": {
            "disable": false,
            "args": [],
            "executable": "/home/usuario/.config/composer/vendor/bin/phpmd",
            "lint_mode": "save",
            "selector": "source.php",
            "rulesets": "cleancode,codesize,controversial,design,naming,unusedcode"
        }
    }
}
kaste commented 5 years ago

Hi! The output hear indicates that you're not sending the whole files to the linter but only the parts between the PHP tags.

I noticed you set selector in the settings. Can you try the default setting? (The default is not the empty string but not setting anything at all.)

p4scu41 commented 5 years ago

yeah, it works. I misunderstood the selector, I thought it refers to the file extension.

Thanks kaste for your quick answer.

kaste commented 5 years ago

👌