New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: argument of type 'NoneType' is not iterable #78
Comments
Can you please paste in your configuration file as it looks to be config related. |
@MindflowAU Any chance you could paste in t he configuration please as I cannot diagnose without it |
Not sure which config file you want, do you mean the ST2 config default and user files? or PHPCS config?
|
There is something broken with the plugin configuration file. I can only replicate this when I remove
From the configuration file. The standard installation of this plugin has that line defined, so either the settings have been deleted or not being pulled down by whichever installation method you are using. Unsure what OS you are using but if you go to Sublime Text Preferences, and from there: Package Settings > PHP Code Sniffer > Settings - Default This file that is opened should look like https://github.com/benmatselby/sublime-phpcs/blob/master/phpcs.sublime-settings If they don't, please copy and paste over. Then from there, you then need to configure the plugin for your needs as per http://www.soulbroken.co.uk/code/sublimephpcs/#configuration |
Hey Ben, thanks for the update 👍 I may have changed that line, not sure, however there is [php] there, it is not empty. Default Config
|
And you are still getting the error? Do you see the extra debug in there since my last commit? |
Ben, OMG I just found something. Alt+Clicking on HOwever - if I alt+click on the second line, it all works as expected! :-/ Here's the app and file https://github.com/MindflowAU/Laravel-4-Bootstrap-Starter-Site/blob/master/app/routes.php So the original problem still exists, but now I can retitle it to "PHPcs not working in ".blade.php" template files (handlebars)", for example: |
I'm afraid you have completely lost me now. Unsure what Alt+Clicking does, as that isn't related to the sublime-phpcs plugin? It looks like you are in Vintage mode? I've just put my ST2 into Vintage mode, and with the file above "routes.php" it generates 10 errors in PSR2, either by saving the file (if execute on save is on) or by just sniffing the file. If I then take a "blade" file from Laravel and run it in this plugin I get: "No PHP code was found in this file and short open tags are not allowed by this install of PHP. This file may be using short open tags but PHP does not allow them." when using PSR2 in PHP_CodeSniffer, both from the plugin and the terminal script. |
Sorry Ben, confusing with other plugin. Yes I'm in Vintage mode, and code sniff did not work well inside handlebars. Should I turn off vintage mode? Was trying to get used to some faster Vi Short Tags - um, blade files use handlebars no need for php tags. I guess Cheers, Chris On 22 May 2013 18:51, Ben Selby notifications@github.com wrote:
|
This plugin wraps PHP_CodeSniffer, so if PHP_CodeSniffer can't handle certain formats, this plugin will not be able to either. So I was just using the PSR2 standard for PHP_CodeSniffer as an example, not all standards will look for the tags. As I mentioned, I can run the plugin with Vintage mode on, as the plugin can execute on save, via right click or the command palette, so this doesn't seem to be interfering with the plugin functionality. All I can help with is regards to if you run the PHP_CodeSniffer command on a file in your terminal and you get different results than in the plugin. If you turn debug mode on for this plugin either in the default or user settings you will see the command that is being executed for phpcs
Copy this command and run in terminal, ideally you get the same results. |
Ok, all is good now, thank you! :) |
Good news, no problem. Any issues, let me know. |
Hi Ben, I've got similar error
When I right-click on any file or folder of my SF2 project and select PHP Code Sniffer Fix this file/directory (php cs fixer) I'm using Sublime Text 2.0.2 I've got the phar executable paths correctly specified at /~/.config/sublime-text-2/Packages/Phpcs/phpcs.sublime-settings Moreover, phpcs show any option disabled when I right-click on a php file text inside my project. What should I do? |
Hi again Ben, But in other hand, I've got an OS permissions error when I try to fix with CS Fixer a php file, using this sublime plugin
Any suggestion? |
I seems that the error comes near this last line of code from """
Fixes the fact that PHP_CodeSniffer now caches the reports to cwd()
- http://pear.php.net/package/PHP_CodeSniffer/download/1.5.0
- https://github.com/benmatselby/sublime-phpcs/issues/68
"""
home = expanduser("~")
debug_message("cwd: " + home)
proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, startupinfo=info, cwd=home) I've tested OS directory permissions by switching home variable to "/tmp" fixed value, but error remains even performing this cwd("/tmp") instead of cwd("/home/myusername") |
@temple Have you seen this section in the readme? |
Hi Ben,
Got an error with your Sublime Text 2 plugin. I just installed it and was testing to see what happens when I just type junk into php... didn't notice anything so I turned on debug and this is what I saw...
Traceback (most recent call last):
File ".\sublime_plugin.py", line 272, in is_enabled_
File ".\phpcs.py", line 605, in is_enabled
File ".\phpcs.py", line 528, in should_execute
TypeError: argument of type 'NoneType' is not iterable
Cheerio
The text was updated successfully, but these errors were encountered: