Page 1 of 1

[BUG] can't turn off CodeSniffer

Posted: Thu May 18, 2017 9:49 pm
by strgt
Once you've finaly find out how to turn the CodeSniffer on, you'll see thousand of errors because all of the rules are very strict. Then, the next step you want to do is to turn it off, but you can't.

I tried different ways, and the most logical one was to unsellect ALL rules, but that didn't work neither.

You'll need a way to turn it on/off without uninstalling it.

Re: [BUG] can't turn off CodeSniffer

Posted: Fri May 19, 2017 2:39 pm
by kaloyan_r
To make it work:
1. Go to the PHP Tools > PHP_CodeSniffer preference page.
2. Select PHP Executable. The "Built-in PHP" should work fine.
3. Select PEAR library: The "<Internal>" should work fine.
4. Select a CodeSniffer Standard, e.g. "Zend".
5. Click the OK button.
6. You will be prompted for that a full rebuild is required. Confirm with "Yes".

The CodeSniffer validation will appear in the code editor and in the Problems view.

To disable the CodeSniffer validation:
1. Go to the PHP Tools > PHP_CodeSniffer preference page.
2. Deselect all items in the CodeSniffer Standards list.
3. Click the OK button.
4. You will be prompted for that a full rebuild is required. Confirm with "Yes".

The CodeSniffer validation will disappear from the code editor and the Problems view.

I've just checked the above with Zend Studio 13.6. If it does not work for, please provide more details.

Re: [BUG] can't turn off CodeSniffer

Posted: Fri May 19, 2017 3:16 pm
by strgt
kaloyan_r wrote: To disable the CodeSniffer validation:
1. Go to the PHP Tools > PHP_CodeSniffer preference page.
2. Deselect all items in the CodeSniffer Standards list.
3. Click the OK button.
4. You will be prompted for that a full rebuild is required. Confirm with "Yes".

The CodeSniffer validation will disappear from the code editor and the Problems view.

I've just checked the above with Zend Studio 13.6. If it does not work for, please provide more details.
It did not. I deselected all items in the standards list and rebuilt the project. The standard rules errors were still shown. What details would you like me to add?

Re: [BUG] can't turn off CodeSniffer

Posted: Mon May 22, 2017 8:24 am
by kaloyan_r
It would help if you attach a screenshot of the preferences dialog and screenshot of the Problems view (in the state where it is supposed to not show CodeSniffer validation, but it still shows it).

Re: [BUG] can't turn off CodeSniffer

Posted: Mon May 22, 2017 12:58 pm
by strgt
CodeSniffer issues did not get solved with a new workspace.

This is the image of the problems view with the PHPCS errors in the editor

Image

And this is the preferences window with no standard selected

Image

Re: [BUG] can't turn off CodeSniffer

Posted: Mon May 22, 2017 4:31 pm
by kaloyan_r
So, I assume that you hit "Yes" when you were asked for the full rebuild, and there aren't any background jobs still running.

The only difference I see with my setup is that I am using the "<Internal>" PEAR library that is built in Zend Studio, while you have configured your own instance. Could you try with the "<Internal>" PEAR library?

Re: [BUG] can't turn off CodeSniffer

Posted: Mon May 22, 2017 9:34 pm
by strgt
kaloyan_r wrote: Could you try with the "<Internal>" PEAR library?

Same result. The only way I was able to get rid of the PHPCS errors was with the following filters:
- File Extensions: *.ignoreAll
- Ignore directories: *