benmatselby / sublime-phpcs

🔍 PHP CodeSniffer, PHP Coding Standard Fixer, Linter, and Mess Detector Support for Sublime Text
Other
811 stars 127 forks source link

PHPCS not working properly #46

Closed Exadra37 closed 11 years ago

Exadra37 commented 11 years ago

PHPCS

PHP_CodeSniffer

PHP-CS-Fixer

PHPPMD

LINTER

default phpcs.sublime-settings:

{
    // Plugin settings

    // Turn the debug output on/off
    "show_debug": false,

    // Which file types (file extensions), do you want the plugin to
    // execute for
    "extensions_to_execute": ["php"],

    // Execute the sniffer on file save
    "phpcs_execute_on_save": true,

    // Show the error list after save.
    "phpcs_show_errors_on_save": true,

    // Show the errors in the gutter
    "phpcs_show_gutter_marks": true,

    // Show outline for errors
    "phpcs_outline_for_errors": true,

    // Show the errors in the status bar
    "phpcs_show_errors_in_status": true,

    // Show the errors in the quick panel so you can then goto line
    "phpcs_show_quick_panel": true,

    // PHP_CodeSniffer settings

    // Do you want to run the phpcs checker?
    "phpcs_sniffer_run": true,

    // Execute the sniffer on file save
    "phpcs_command_on_save": true,

    // It seems python/sublime cannot always find the phpcs application
    // If empty, then use PATH version of phpcs, else use the set value
    "phpcs_executable_path": "",

    // Additional arguments you can specify into the application
    //
    // Example:
    // {
    //     "--standard": "PEAR",
    //     "-n"
    // }
    "phpcs_additional_args": {
        "--standard": "PEAR",
        "-n": ""
    },

    // PHP-CS-Fixer settings

    // Fix the issues on save
    "php_cs_fixer_on_save": false,

    // Show the quick panel
    "php_cs_fixer_show_quick_panel": false,

    // Path to where you have the php-cs-fixer installed
    "php_cs_fixer_executable_path": "",

    // Additional arguments you can specify into the application
    //
    // Example:
    // {
    //     "--level": "all"
    // }
    "php_cs_fixer_additional_args": {
        "--level": "all"
    },

    // PHP Linter settings

    // Are we going to run php -l over the file?
    "phpcs_linter_run": true,

    // Execute the linter on file save
    "phpcs_linter_command_on_save": true,

    // It seems python/sublime cannot always find the php application
    // If empty, then use PATH version of php, else use the set value
    "phpcs_php_path": "",

    // What is the regex for the linter? Has to provide a named match for 'message' and 'line'
    "phpcs_linter_regex": "(?P.*) on line (?P\\d+)",

    // PHP Mess Detector settings

    // Execute phpmd
    "phpmd_run": false,

    // Execute the phpmd on file save
    "phpmd_command_on_save": true,

    // It seems python/sublime cannot always find the phpmd application
    // If empty, then use PATH version of phpmd, else use the set value
    "phpmd_executable_path": "",

    // Additional arguments you can specify into the application
    //
    // Example:
    // {
    //     "codesize,unusedcode"
    // }
    "phpmd_additional_args": {
        "codesize,unusedcode,naming": ""
    }
}

user phpcs.sublime-settings:

 {
    /**
      * PHPCS PLUGIN
      */

    // Turn the debug output on/off
    "show_debug":false,

     // Execute the sniffer on file save
    "phpcs_execute_on_save": false,

    // It seems python/sublime cannot always find the phpcs application
    // If empty, then use PATH version of phpcs, else use the set value
    "phpcs_executable_path": "/usr/bin/phpcs",

    /**
     * PHP_CS_FIXER
     */

    // Fix the issues on save
    "php_cs_fixer_on_save": true,

    // Show the quick panel
    "php_cs_fixer_show_quick_panel": true,

    // Path to where you have the php-cs-fixer installed
    "php_cs_fixer_executable_path": "/usr/local/bin/php-cs-fixer",
     // Path to where you have the php-cs-fixer installed
    //"php_cs_fixer_executable_path": "/home/exadra37/Transferências/php-cs-fixer.phar",

    // Additional arguments you can specify into the application
    //
    // Example:
    // {
    //     "--level": "all"
    // }
    // "php_cs_fixer_additional_args": {
    //     "--fixers": "identation,linefeed,trailing_spaces,unused_use,php_closing_tag,short_tag,return,visibility,eof_ending,extra_empty_lines,include,psr0,controls_spaces,elseif"
    // },

    /**
     * PHP Linter
     */
    // It seems python/sublime cannot always find the php application
    // If empty, then use PATH version of php, else use the set value
    "phpcs_php_path": "/usr/bin/phpcs",

    /*
     * PHPMD
     */

    // Execute phpmd
    "phpmd_run": true,

    // It seems python/sublime cannot always find the phpmd application
    // If empty, then use PATH version of phpmd, else use the set value
    "phpmd_executable_path": "/usr/bin/phpmd"
}

I like very much to use this plugin, but this 3 time i try withou any sucess.

I have a fresh install from ubuntu 12.04.1 and last sublime text 2 version.

Can anybody point to me what is wrong?

Many thanks

benmatselby commented 11 years ago

Can you please turn the debugging information on and post that on here please. I cannot really help without that information.

"show_debug": true,

And then turn on the console: "View" > "Turn on console"

This will then display what commands are trying to be run..

Exadra37 commented 11 years ago
"show_debug": true,

I add this to sublimecodeintel default settings.

The message from console:

startup, version: 2217 linux x64 channel: stable
executable: /usr/lib/Sublime Text 2/sublime_text
working dir: /home/exadra37
packages path: /home/exadra37/.config/sublime-text-2/Packages
settings path: /home/exadra37/.config/sublime-text-2/Settings
PackageSetup not required
Py_GetProgramName(): sublime_text
Py_GetExecPrefix(): .
Py_GetProgramFullPath(): 
Py_GetPath(): ./lib/python26.zip:./lib/python2.6/:./lib/python2.6/plat-linux2:./lib/python2.6/lib-tk:./lib/python2.6/lib-old:./lib/python2.6/lib-dynload
Py_GetPythonHome(): .
catalogue loaded
found 17 files for base name Default.sublime-keymap
found 2 files for base name Default.sublime-mousemap
found 11 files for base name Main.sublime-menu
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/AAA.py
[AAAPackageDev] Added sublime_lib to sys.path.
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/build_sys_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/commands_file_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/completions_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/package_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/settings_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/setup.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./setup.py", line 9, in 
    from distutils import log, dir_util, dep_util, file_util, archive_util
ImportError: No module named distutils
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/snippet_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/sublime_inspect.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/syntax_def_dev.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./syntax_def_dev.py", line 4, in 
    import xml.parsers.expat
  File ".\xml\parsers\expat.py", line 4, in 
ImportError: No module named pyexpat
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/BracketHighlighter/BracketHighlighter.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/BracketHighlighter/Elements.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/BracketHighlighter/bracket_plugin.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/CSS/css_completions.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Case Conversion/case_conversion.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/comment.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/copy_path.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/delete_word.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/detect_indentation.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/duplicate_line.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/echo.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/exec.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/fold.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/font.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/goto_line.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/indentation.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/kill_ring.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/mark.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/new_templates.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/open_file_settings.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/open_in_browser.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/paragraph.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/save_on_focus_lost.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/scroll.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/set_unsaved_view_name.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/side_bar.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/sort.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/swap_line.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/switch_file.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/transform.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/transpose.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/trim_trailing_white_space.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Diff/diff.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/DocBlockr/jsdocs.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Goto Documentation/gotodocumentation.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/HTML/encode_html_entities.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/HTML/html_completions.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Package Control/Package Control.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/PhpDox/PhpDox.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Phpcs/phpcs.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/SFTP/SFTP.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/SideBarEnhancements/SideBar.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/SideBarEnhancements/StatusBarFileSize.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/SideBarEnhancements/StatusBarModifiedTime.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/SublimeCodeIntel/SublimeCodeIntel.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/Tag.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_close_tag.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_close_tag_on_slash.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_indent.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_insert_as_tag.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_lint.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_remove.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_remove_attributes.py
plugin init time: 0.228527
loading bindings
loading pointer bindings
found 1 files for base name Soda Dark.sublime-theme
theme loaded
app ready
pre session restore time: 0.522661
using gamma: 1 (err: 0)
startup cache, total files: 238 cache hits: 238
startup time: 1.20955 (package setup was not run)
loaded 876 snippets
Package Control: Skipping automatic upgrade, last run at 2012-09-30 11:41:45, next run at 2012-09-30 12:41:45 or after
Exception in thread scanning thread:
Traceback (most recent call last):
  File ".\threading.py", line 532, in __bootstrap_inner
  File ".\threading.py", line 484, in run
  File "./SublimeCodeIntel.py", line 606, in _codeintel_scan
  File "/home/exadra37/.config/sublime-text-2/Packages/SublimeCodeIntel/libs/codeintel2/manager.py", line 351, in buf_from_content
    buf = buf_class(self, accessor, env, path, encoding)
  File "/home/exadra37/.config/sublime-text-2/Packages/SublimeCodeIntel/libs/codeintel2/lang_php.py", line 1168, in __init__
    super(PHPBuffer, self).__init__(*args, **kwargs)
TypeError: super(type, obj): obj must be an instance or subtype of type

The buffer problem just happen if i have anything open in system. I have to close all programs and just le sublime text running to not have this problem.

I have a 64 bit computers with dual core 2.1 GHz and 4GB ram . If the ram goes up 1GB the buffer problem come back.

The DB folder have 15 files and 3.2MB, but the the size and numbers of files haven change for more than 24 hours.

benmatselby commented 11 years ago

You changed "sublimecodeintel" settings or "Phpcs"?

This doesn't look to be a Phpcs issue from what I can see in that debugging. Please check if you have turned the debugging on for this plugin.

Exadra37 commented 11 years ago

Sorry for the confusion, because i have also a issue with sublimecodeintel to index the code...

Now i turn debug on in phpcs and the message in console panel is:

startup, version: 2217 linux x64 channel: stable
executable: /usr/lib/Sublime Text 2/sublime_text
working dir: /home/exadra37
packages path: /home/exadra37/.config/sublime-text-2/Packages
settings path: /home/exadra37/.config/sublime-text-2/Settings
PackageSetup not required
Py_GetProgramName(): sublime_text
Py_GetExecPrefix(): .
Py_GetProgramFullPath(): 
Py_GetPath(): ./lib/python26.zip:./lib/python2.6/:./lib/python2.6/plat-linux2:./lib/python2.6/lib-tk:./lib/python2.6/lib-old:./lib/python2.6/lib-dynload
Py_GetPythonHome(): .
catalogue loaded
found 17 files for base name Default.sublime-keymap
found 2 files for base name Default.sublime-mousemap
found 11 files for base name Main.sublime-menu
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/AAA.py
[AAAPackageDev] Added sublime_lib to sys.path.
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/build_sys_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/commands_file_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/completions_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/package_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/settings_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/setup.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./setup.py", line 9, in 
    from distutils import log, dir_util, dep_util, file_util, archive_util
ImportError: No module named distutils
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/snippet_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/sublime_inspect.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/syntax_def_dev.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./syntax_def_dev.py", line 4, in 
    import xml.parsers.expat
  File ".\xml\parsers\expat.py", line 4, in 
ImportError: No module named pyexpat
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/BracketHighlighter/BracketHighlighter.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/BracketHighlighter/Elements.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/BracketHighlighter/bracket_plugin.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/CSS/css_completions.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Case Conversion/case_conversion.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/comment.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/copy_path.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/delete_word.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/detect_indentation.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/duplicate_line.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/echo.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/exec.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/fold.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/font.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/goto_line.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/indentation.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/kill_ring.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/mark.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/new_templates.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/open_file_settings.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/open_in_browser.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/paragraph.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/save_on_focus_lost.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/scroll.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/set_unsaved_view_name.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/side_bar.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/sort.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/swap_line.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/switch_file.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/transform.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/transpose.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/trim_trailing_white_space.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Diff/diff.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/DocBlockr/jsdocs.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Goto Documentation/gotodocumentation.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/HTML/encode_html_entities.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/HTML/html_completions.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Package Control/Package Control.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/PhpDox/PhpDox.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Phpcs/phpcs.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/SFTP/SFTP.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/SideBarEnhancements/SideBar.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/SideBarEnhancements/StatusBarFileSize.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/SideBarEnhancements/StatusBarModifiedTime.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/SublimeCodeIntel/SublimeCodeIntel.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/Tag.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_close_tag.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_close_tag_on_slash.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_indent.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_insert_as_tag.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_lint.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_remove.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_remove_attributes.py
plugin init time: 0.221971
loading bindings
loading pointer bindings
found 1 files for base name Soda Dark.sublime-theme
theme loaded
app ready
pre session restore time: 0.49314
using gamma: 1 (err: 0)
startup cache, total files: 238 cache hits: 238
startup time: 1.11179 (package setup was not run)
loaded 876 snippets
Package Control: Skipping automatic upgrade, last run at 2012-09-30 20:53:22, next run at 2012-09-30 21:53:22 or after
[Phpcs] /usr/bin/phpcs -l -d display_errors=On /home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php
[Phpcs] ERROR: option "- " not known.
Usage: phpcs [-nwlsaepvi] [-d key[=value]]
    [--report=] [--report-file=] [--report-=] ...
    [--report-width=] [--generator=] [--tab-width=]
    [--severity=] [--error-severity=] [--warning-severity=]
    [--config-set key value] [--config-delete key] [--config-show]
    [--standard=] [--sniffs=] [--encoding=]
    [--extensions=] [--ignore=]  ...
        -n            Do not print warnings (shortcut for --warning-severity=0)
        -w            Print both warnings and errors (on by default)
        -l            Local directory only, no recursion
        -s            Show sniff codes in all reports
        -a            Run interactively
        -e            Explain a standard by showing the sniffs it includes
        -p            Show progress of the run
        -v[v][v]      Print verbose output
        -i            Show a list of installed coding standards
        -d            Set the [key] php.ini value to [value] or [true] if value is omitted
        --help        Print this help message
        --version     Print version information
                One or more files and/or directories to check
          A comma separated list of file extensions to check
                      (only valid if checking a directory)
            A comma separated list of patterns to ignore files and directories
            The encoding of the files being checked (default is iso-8859-1)
              A comma separated list of sniff codes to limit the check to
                      (all sniffs must be part of the specified standard)
            The minimum severity required to display an error or warning
            The name or path of the coding standard to use
            The number of spaces each tab represents
           The name of a doc generator to use
                      (forces doc generation instead of checking)
              Print either the "full", "xml", "checkstyle", "csv", "emacs"
                      "source", "summary", "svnblame", "gitblame", "hgblame" or
                      "notifysend" report
                      (the "full" report is printed by default)
          Write the report to the specified file path
         How many columns wide screen reports should be printed
[Phpcs] /usr/bin/phpcs --report=checkstyle -n --standard=PEAR --encoding=utf-8 /home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php
[Phpcs] 

 
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
 

[Phpcs] /usr/bin/phpmd /home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php text codesize,unusedcode,naming
[Phpcs] 
/home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php:7   Avoid excessively long variable names like $nr_Elementos_a_combinar. Keep variable name length under 20.
/home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php:7   Avoid excessively long variable names like $nr_Elementos_por_Combinacao. Keep variable name length under 20.
/home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php:9   Avoid unused local variables such as '$numero_Combinacoes'.
/home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php:35  The method gerar_Combinacoes_Possiveis() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
/home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php:82  Avoid excessively long variable names like $combinacoes_efectuadas. Keep variable name length under 20.
/home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php:87  Avoid excessively long variable names like $combinacoes_possiveis. Keep variable name length under 20.
[Phpcs] Linter found 0 errors
[Phpcs] Sniffer found 16 errors
[Phpcs] MessDetector found 6 errors
[Phpcs] /usr/local/bin/php-cs-fixer fix --verbose --fixers=identation,linefeed,trailing_spaces,unused_use,php_closing_tag,short_tag,return,visibility,eof_ending,extra_empty_lines,include,psr0,controls_spaces,elseif /home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php
[Phpcs] ! Class combinacoes in /home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php should have at least a vendor namespace according to PSR-0 rules

The linter found 0 errors can't be true because the file have errors.

About the fixer i realized, if i have more than one error per line, it will just report one error, and try to fix one. For example if i not set the visibility of a function and if the word is not indent correctly(start column 5 instead column 4) , will not fix.

The fixer only works on save, if i try to run the fixer without save, will not do anything.

benmatselby commented 11 years ago

OK, so the linter does not work due to:

"phpcs_php_path": "/usr/bin/phpcs",

This needs to be the php path, not the path to phpcs. As you can see:

[Phpcs] /usr/bin/phpcs -l -d display_errors=On /home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php
[Phpcs] ERROR: option "- " not known.

So this is the linter command (-l) using the php path, which is currently set to phpcs. May need this configuration to be:

"phpcs_php_path": "/usr/bin/php",

With regards to the php-cs-fixer, does this work as intended on the command line? This plugin shells out to the command line, so if the tool is executing it should work in the same vein.

Exadra37 commented 11 years ago

What a stupid mistake i have made...

Now the linter have the correct path, as you provide, but still not work on save or on the fly.

Now as you can see in the debug, the phpmd and linter, do not show the errors, and they still in the code:

startup, version: 2217 linux x64 channel: stable
executable: /usr/lib/Sublime Text 2/sublime_text
working dir: /home/exadra37
packages path: /home/exadra37/.config/sublime-text-2/Packages
settings path: /home/exadra37/.config/sublime-text-2/Settings
PackageSetup not required
Py_GetProgramName(): sublime_text
Py_GetExecPrefix(): .
Py_GetProgramFullPath(): 
Py_GetPath(): ./lib/python26.zip:./lib/python2.6/:./lib/python2.6/plat-linux2:./lib/python2.6/lib-tk:./lib/python2.6/lib-old:./lib/python2.6/lib-dynload
Py_GetPythonHome(): .
catalogue loaded
found 16 files for base name Default.sublime-keymap
found 1 files for base name Default.sublime-mousemap
found 10 files for base name Main.sublime-menu
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/AAA.py
[AAAPackageDev] Added sublime_lib to sys.path.
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/build_sys_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/commands_file_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/completions_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/package_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/settings_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/setup.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./setup.py", line 9, in 
    from distutils import log, dir_util, dep_util, file_util, archive_util
ImportError: No module named distutils
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/snippet_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/sublime_inspect.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/syntax_def_dev.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./syntax_def_dev.py", line 4, in 
    import xml.parsers.expat
  File ".\xml\parsers\expat.py", line 4, in 
ImportError: No module named pyexpat
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/BracketHighlighter/BracketHighlighter.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/BracketHighlighter/Elements.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/BracketHighlighter/bracket_plugin.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/CSS/css_completions.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Case Conversion/case_conversion.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/comment.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/copy_path.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/delete_word.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/detect_indentation.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/duplicate_line.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/echo.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/exec.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/fold.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/font.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/goto_line.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/indentation.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/kill_ring.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/mark.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/new_templates.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/open_file_settings.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/open_in_browser.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/paragraph.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/save_on_focus_lost.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/scroll.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/set_unsaved_view_name.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/side_bar.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/sort.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/swap_line.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/switch_file.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/transform.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/transpose.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/trim_trailing_white_space.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Diff/diff.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/DocBlockr/jsdocs.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Goto Documentation/gotodocumentation.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/HTML/encode_html_entities.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/HTML/html_completions.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Package Control/Package Control.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/PhpDox/PhpDox.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Phpcs/phpcs.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/SFTP/SFTP.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/SideBarEnhancements/SideBar.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/SideBarEnhancements/StatusBarFileSize.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/SideBarEnhancements/StatusBarModifiedTime.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/Tag.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_close_tag.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_close_tag_on_slash.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_indent.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_insert_as_tag.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_lint.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_remove.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_remove_attributes.py
plugin init time: 0.15396
loading bindings
loading pointer bindings
found 1 files for base name Soda Dark.sublime-theme
theme loaded
app ready
pre session restore time: 0.324275
using gamma: 1 (err: 0)
startup cache, total files: 234 cache hits: 234
startup time: 0.519136 (package setup was not run)
loaded 876 snippets
Package Control: Skipping automatic upgrade, last run at 2012-10-01 10:04:09, next run at 2012-10-01 11:04:09 or after
Writing file /home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php with encoding UTF-8
[Phpcs] /usr/local/bin/php-cs-fixer fix --verbose --level=all /home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php
[Phpcs] ! Class combinacoes in /home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php should have at least a vendor namespace according to PSR-0 rules
Run from terminal console in ubuntu:
username@Acer-5738ZG:~$ phpmd /home/username/sites/tvcabo-testes/modules/usernametotoloto/old_files/combinacoes.php text codesize,unusedcode,naming
/home/username/sites/tvcabo-testes/modules/usernametotoloto/old_files/combinacoes.php - Unexpected token: $Elementos, line: 46, col: 9, file: /home/username/sites/tvcabo-testes/modules/usernametotoloto/old_files/combinacoes.php.
username@Acer-5738ZG:~$ php-cs-fixer fix /home/username/sites/tvcabo-testes/modules/usernametotoloto/old_files/combinacoes.php --level=all! Class combinacoes in /home/username/sites/tvcabo-testes/modules/usernametotoloto/old_files/combinacoes.php should have at least a vendor namespace according to PSR-0 rules
   1) /home/username/sites/tvcabo-testes/modules/usernametotoloto/old_files/combinacoes.php
My php file:

if (!defined('_PS_VERSION_'))
    exit;
class combinacoes
{
    public function calcular_Combinacoes_Possiveis($nr_Elementos_a_combinar, $nr_Elementos_por_Combinacao)
    {
        return $numero_Combinacoes = Pow($nr_Elementos_a_combinar, $nr_Elementos_por_Combinacao);
    }
    /**
     * Esta função permite gerar todas as combinacoes possiveis de elementos de qualquer tipo, estabelecendo um numero máximo de elementos por combinação.
     * @author Jonas Raoni Soares Silva     http://br.groups.yahoo.com/group/php-pt/message/70557
     * @author Exadra37                     http://asualojaonline.com
     *
     * @param mixed $Elementos Podemos combinar letras com números, letras com letras, numeros com numeros, etc... .
     *                                          Cada elemento tem de estar separado por um simbolo como por exemplo $Elementos = "a-b-c-1-2-156-exadra37-2012"
     * @param integer $MaxLength           Número máximo de elementos por combinação
     * @param string  $explode_symbol      Simbolo a utilizar para separar $elementos num array. No exemplo acima separamos os elementos com o simbolo '-'.
     * @param boolean $Elementos_is_String True -  Efectua o explode da string para array.
     * @param boolean $filtrar             True -  Todas as combinações geradas serão filtradas.
     *                                          Não se repetirão condições do género 'a' com 'b' e 'b' com 'a'.
     *                                          Neste caso o filtro manterá só a combinação 'a' com 'b'.
     * @param boolean $fixar_Elemento True - Todas as combinações geradas contêm o primeiro elemento de $Elementos, que no exemplo acima é 'a'.
     *                                          O elemento que queremos fixar tem de ser sempre o primeiro de $Elementos.
     * @return array $combinacoes_Resultantes   O resultado será retornado num array.
     *                                          O array conterá todas as combinações possiveis ou apenas as filtradas, conforme $filtrar esteja true ou false.
     *
     * @improvements            14-09-2012                  Exadra37    - Adicionei variáveis $explode_symbol, $Elementos_is_Array, $filtrar e $fixar_elemento.
     *                                                                  - Adicionei a função associar_Combinacoes($Combinacoes, $Elementos, $associar = true, $echo = false).
     *
     * TODO:                    14-09-2012                  Alterar a funcionalidade fixar_Elemento para permitir fixar um elemento em qualquer posição de $Elementos.
     */
    public function gerar_Combinacoes_Possiveis($Elementos, $MaxLength = 2, $explode_symbol = '-', $filtrar = true, $fixar_Elemento = false)
        //Coloque os digitos, letras, strings, números, etc... Q deverão fazer parte das combinações
        //Pode ser $Digits = 'a-2-Jonas-AA';
        //$Elementos = '0-1-2-3-4-5-6-7-8-9';
        //Número máximo de elementos por combinação
        //$MaxLength = 2;
        //$fixar_Elemento = (int) $fixar_Elemento;
        //Preparar os digitos
        $Elementos = Explode($explode_symbol,$Elementos);
        //Preparar array para armazenamento temporário da combinação
        $Combinacao=array()
        $Combinacoes_keys=array();
        for ($i=0; $i<$MaxLength; $i++) {
                $Combinacao[$i] = 0;
        }
        // Acha o número de combinações possiveis usando a função nativa do php pow(base, exp)
        $CombinacoesCount = Pow(SizeOf($Elementos), $MaxLength);
        $Combinacoes = array();
        //Agora com o número de combinações possíveis tudo fica mto + fácil :]
        //Isso aki eh como se fosse um "Faça x ateh acabar as combinações possíveis. E qdo q acaba??? Naum sei, se vire!!!"
        for ($z=0; $z<$CombinacoesCount; $z++) {
            //  Passar de "caracter" em "caracter", aumentando seus valores na ordem "unidade->dezena->centena...", eh como se fosse um cronômetro,
            //  "chegou no máximo dos segundos, zerar segundo e incrementar o minuto"
            for ($i=$MaxLength-1; $i>=0; $i--) {
                if($Combinacao[$i] == SizeOf($Elementos)-1 )
                    $Combinacao[$i] = 0;
                else {
                    if (!($fixar_Elemento AND $i == 0)) {
                        $Combinacao[$i]++;
                         break;
                    }
                }
            }
            if ($filtrar AND (count(array_unique($Combinacao))) === $MaxLength) {
                natsort($Combinacao);
                $key_array = implode('-', $Combinacao);
                if (!array_key_exists($key_array, $Combinacoes_keys)) {
                    $combinacoes_efectuadas++;
                    $Combinacoes_keys[$key_array] = $Combinacao;
                    //$Combinacoes[]=$Combinacao;
                }
            }
            $combinacoes_possiveis++;
            $Combinacoes[]=$Combinacao;
        }
        //var_dumping($Combinacoes, 'Combinacoes');
        echo '
Foram efectuadas '.$combinacoes_efectuadas.' combinações e rejeitadas pelo filtro '.($combinacoes_possiveis-$combinacoes_efectuadas).' combinações
'; // Por gravar as combinações usando as chaves da array Elementos ao invés dos próprios elementos, tornou-se possível a mistura de strings com // inteiros sem a necessidade de uma implementação enorme, agora eh soh puxar os valores da array de acordo com a combinação e prontio :] foreach ($Combinacoes_keys As $Combination) { foreach($Combination As $Cod) echo $Elementos[$Cod]; echo '
'; } }
benmatselby commented 11 years ago

So the linting didn't seem to run then, is it turned on?

Also, you're output from the linter might not meet this regex:

"phpcs_linter_regex": "(?P.*) on line (?P\\d+)",

So you may need to check that.

I'm now a little lost as to what is and isn't working.

So phpcs is working? Linting isn't? phpmd ? php-cs-fixer?

Exadra37 commented 11 years ago

The linter is set to true and you can see my configuration settings in my first post, i just changed the linter path as you tell me to do and i set phpcs to not run on save.

I run sniff this file and the debug print this:

startup, version: 2217 linux x64 channel: stable
executable: /usr/lib/Sublime Text 2/sublime_text
working dir: /home/exadra37
packages path: /home/exadra37/.config/sublime-text-2/Packages
settings path: /home/exadra37/.config/sublime-text-2/Settings
PackageSetup not required
Py_GetProgramName(): sublime_text
Py_GetExecPrefix(): .
Py_GetProgramFullPath(): 
Py_GetPath(): ./lib/python26.zip:./lib/python2.6/:./lib/python2.6/plat-linux2:./lib/python2.6/lib-tk:./lib/python2.6/lib-old:./lib/python2.6/lib-dynload
Py_GetPythonHome(): .
catalogue loaded
found 16 files for base name Default.sublime-keymap
found 1 files for base name Default.sublime-mousemap
found 10 files for base name Main.sublime-menu
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/AAA.py
[AAAPackageDev] Added sublime_lib to sys.path.
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/build_sys_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/commands_file_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/completions_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/package_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/settings_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/setup.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./setup.py", line 9, in 
    from distutils import log, dir_util, dep_util, file_util, archive_util
ImportError: No module named distutils
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/snippet_dev.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/sublime_inspect.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/AAAPackageDev/syntax_def_dev.py
Traceback (most recent call last):
  File "./sublime_plugin.py", line 62, in reload_plugin
  File "./syntax_def_dev.py", line 4, in 
    import xml.parsers.expat
  File ".\xml\parsers\expat.py", line 4, in 
ImportError: No module named pyexpat
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/BracketHighlighter/BracketHighlighter.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/BracketHighlighter/Elements.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/BracketHighlighter/bracket_plugin.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/CSS/css_completions.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Case Conversion/case_conversion.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/comment.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/copy_path.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/delete_word.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/detect_indentation.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/duplicate_line.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/echo.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/exec.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/fold.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/font.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/goto_line.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/indentation.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/kill_ring.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/mark.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/new_templates.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/open_file_settings.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/open_in_browser.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/paragraph.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/save_on_focus_lost.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/scroll.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/set_unsaved_view_name.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/side_bar.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/sort.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/swap_line.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/switch_file.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/transform.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/transpose.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Default/trim_trailing_white_space.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Diff/diff.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/DocBlockr/jsdocs.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Goto Documentation/gotodocumentation.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/HTML/encode_html_entities.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/HTML/html_completions.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Package Control/Package Control.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/PhpDox/PhpDox.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Phpcs/phpcs.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/SFTP/SFTP.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/SideBarEnhancements/SideBar.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/SideBarEnhancements/StatusBarFileSize.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/SideBarEnhancements/StatusBarModifiedTime.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/Tag.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_close_tag.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_close_tag_on_slash.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_indent.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_insert_as_tag.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_lint.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_remove.py
Reloading plugin /home/exadra37/.config/sublime-text-2/Packages/Tag/tag_remove_attributes.py
plugin init time: 0.15396
loading bindings
loading pointer bindings
found 1 files for base name Soda Dark.sublime-theme
theme loaded
app ready
pre session restore time: 0.324275
using gamma: 1 (err: 0)
startup cache, total files: 234 cache hits: 234
startup time: 0.519136 (package setup was not run)
loaded 876 snippets
Package Control: Skipping automatic upgrade, last run at 2012-10-01 10:04:09, next run at 2012-10-01 11:04:09 or after
Writing file /home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php with encoding UTF-8
[Phpcs] /usr/local/bin/php-cs-fixer fix --verbose --level=all /home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php
[Phpcs] ! Class combinacoes in /home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php should have at least a vendor namespace according to PSR-0 rules
[Phpcs] /usr/bin/php -l -d display_errors=On /home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php
[Phpcs] 
Parse error: syntax error, unexpected T_VARIABLE, expecting ';' or '{' in /home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php on line 46
Errors parsing /home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php
[Phpcs] /usr/bin/phpcs --report=checkstyle -n --standard=PEAR --encoding=utf-8 /home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php
[Phpcs] 

 
  
 

[Phpcs] /usr/bin/phpmd /home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php text codesize,unusedcode,naming
[Phpcs] 
/home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php -   Unexpected token: $Elementos, line: 46, col: 9, file: /home/exadra37/public_html/tvcabo-testes/modules/exadra37totoloto/old_files/combinacoes.php.
[Phpcs] Linter found 1 errors
[Phpcs] Sniffer found 1 errors

[Phpcs] MessDetector found 0 errors Unable to decode /home/exadra37/.config/sublime-text-2/Packages/Theme - Default/cross.png

The linter seem to work but is not printing to the line in status bar at the bottom.

I do not understand how i can change the regex of the linter.

The phpmd don't found the errors in the code anymore, as it have done before in this file.

Save the php file that i post in the last post and see by yourself.

benmatselby commented 11 years ago

Linter is having issues due to the "unable to decode" message. According to http://www.sublimetext.com/docs/2/api_reference.html#sublime.View "cross" is a valid icon, so this seems to be something relating to the current build of sublime.

It should still be displaying the error in the quick panel. Using your file, it certainly does for me.

I am now looking at the phpmd issue you are having

benmatselby commented 11 years ago

I've now figured out what is wrong with phpmd. Basically, I use regular expressions in order to parse the output from each application and render into the quick panel and onto the gutter etc.

Using the file you have provided above, it has parse errors in it, which causes the phpmd application to not print the output in the same vein. It is basically telling you what the linter is telling you.

Example:

$ /usr/local/bin/phpmd /Users/Ben/Desktop/test.php text codesize,unusedcode,naming

/Users/Ben/Desktop/test.php -   Unexpected token: echo, line: 80, col: 9, file: /Users/Ben/Desktop/test.php.

So that output does not follow the normal output of:

$ /usr/local/bin/phpmd /Users/Ben/Desktop/test.php text codesize,unusedcode,naming

/Users/Ben/Desktop/test.php:8   Avoid excessively long variable names like $nr_Elementos_a_combinar. Keep variable name length under 20.
/Users/Ben/Desktop/test.php:8   Avoid excessively long variable names like $nr_Elementos_por_Combinacao. Keep variable name length under 20.
/Users/Ben/Desktop/test.php:10  Avoid unused local variables such as '$numero_Combinacoes'.
/Users/Ben/Desktop/test.php:36  The method gerar_Combinacoes_Possiveis() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
/Users/Ben/Desktop/test.php:71  Avoid excessively long variable names like $combinacoes_efectuadas. Keep variable name length under 20.
/Users/Ben/Desktop/test.php:76  Avoid excessively long variable names like $combinacoes_possiveis. Keep variable name length under 20.
/Users/Ben/Desktop/test.php:77  Avoid unused local variables such as '$Combinacoes'.

If I fixed all the parse errors, and re-run in Sublime Text 2, phpmd then can return the errors for mess detection.

After reviewing everything that you have mentioned on here, it seems to be related to configuration, icon errors that are beyond my control, or error condition formatting, which is actually covered in a different application.

With regards to the cross issue, I will monitor the next build of ST2. If this still has an issue, I will convert the cross icon back to a circle, which I'm reluctant to do based on the API documentation

Are you happy for me to close this?

Exadra37 commented 11 years ago

Ok , if you can't fix i will uninstall phpcs and return to sublimeLinter.

Thanks for try to help.

benmatselby commented 11 years ago

Hi there. Other than the cross icon not rendering in the gutter, the rest of the plugin works as intended. I have sent a question into ask why the "cross" icon use to be there in previous builds, and since removed. Once I have the answer, I will make the decision to leave the cross there if it is a bug in ST2, or replace with the circle that is used for the other errors.

Since ST2 seems to default to circle in the gutter if other icons are not there, or at least it is for me, I do not see this as a major bug right now.

Apologies if this plugin does not meet your requirements.

Exadra37 commented 11 years ago

As said before the php-cs-fixer , don't fix properly if have more than one error per line or if indentation is not correct.

The Linter also don't work properly.

The phmd work fine after all the code is fixed.

When the all package work as expected i will install again.

Many thanks for the time you take with me.

benmatselby commented 11 years ago

I've just created the scenario you mentioned with php-cs-fixer and it works the same from the command line and from the plugin, which is to be expected as the plugin shells out the command to the terminal. I used --level=all and didn't specify all the fixers like you have. Maybe try and compare the difference between the terminal and the plugin?

Also, if you can supply the output from the terminal when you lint the file, that would help with regards to the linter. This seems like settings/differences between machines, as I've checked your file on mac, ubuntu and windows, and the linting is working fine.

Exadra37 commented 11 years ago

If you remove public from function gerar_Combinações_Possiveis and let the word function start in column 5, the php-cs-fixer, will not add public to the function, but if you put the word function to start at column 4, php-cs-fixer will add public to the function.

No matter if you run from command line or in sublime text 2, the result will be the same.

How can i run Lint from command line?

benmatselby commented 11 years ago

That is a bug with php-cs-fixer and not with this plugin, so potentially that needs to be raised here: https://github.com/fabpot/PHP-CS-Fixer

To run the linter from the command line you need to do:

$ php -l [FILE]
Exadra37 commented 11 years ago

I will report the bug in php-cs-fixer page... Thanks!

I run php -l from command line, and the output is this:

username@Acer-5738ZG:~$ php -l /home/username/public_html/tvcabo-testes/modules/usernametotoloto/old_files/combinacoes.php
PHP Parse error:  syntax error, unexpected T_VARIABLE, expecting ';' or '{' in /home/username/public_html/tvcabo-testes/modules/usernametotoloto/old_files/combinacoes.php on line 46
Errors parsing /home/username/public_html/tvcabo-testes/modules/usernametotoloto/old_files/combinacoes.php
username@Acer-5738ZG:~$ 

That is the first error that i have in file, but i have more...

In sublime don't show anything on the fly or on save.

The update you have made to phpcs will automatically update in my computer when i restart Sublime Text 2 ???... because i have done that and still everything in the same.

benmatselby commented 11 years ago

The update I put in was simply to make the gutter icon be a circle, that shouldn't affect the functionality. I'm still looking at the linter issue, as it seems to match the regex from what I can tell.

The linter will only report the first error in a file, FYI.

Exadra37 commented 11 years ago

Ok i will wait for your fix.

Once more, many thanks to your effort in this issue.

kazitanvirahsan commented 9 years ago

In my case phpmd was not working properly because I did not pass the phpmd_additional_args.