ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Sublime​Linter-phpcs

by SublimeLinter ST3

SublimeLinter plugin for PHP, using phpcs.

Details

Installs

  • Total 51K
  • Win 26K
  • OS X 15K
  • Linux 11K
Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8
Windows 24 30 25 50 46 35 38 44 21 22 31 37 23 41 48 33 21 24 38 40 38 52 18 31 26 43 46 41 45 35 22 39 59 57 53 64 27 43 66 52 60 42 24 21 33 27
OS X 14 9 15 22 27 16 31 22 14 11 20 15 28 22 25 7 14 34 25 16 19 18 16 12 18 23 42 33 49 20 17 29 22 34 32 39 23 31 43 58 50 31 18 18 13 20
Linux 4 9 13 26 14 12 10 15 7 7 26 18 11 14 19 13 13 16 18 21 18 18 6 8 10 12 9 11 20 11 10 20 23 19 23 29 10 12 22 28 14 13 7 9 13 19

Readme

Source
raw.​githubusercontent.​com

SublimeLinter-phpcs

Build Status

This linter plugin for SublimeLinter provides an interface to phpcs. It will be used with files that have the “PHP”, “HTML” and “HTML5” syntax.

Installation

SublimeLinter 3 must be installed in order to use this plugin. If SublimeLinter 3 is not installed, please follow the instructions here.

Linter installation

Before using this plugin, you must ensure that phpcs is installed on your system, preferably somewhere in your PATH. To install phpcs, follow the instructions on https://github.com/squizlabs/PHP_CodeSniffer#installation. Once phpcs is installed, you can proceed installing the SublimeLinter-phpcs plugin if you did not already do this (the order does not matter).

Plugin installation

Please use Package Control to install the linter plugin. This will ensure that the plugin will be updated when new versions are available. If you want to install from source so you can modify the source code, you probably know what you are doing so we won’t cover that here.

To install via Package Control, do the following:

  1. Within Sublime Text, bring up the Command Palette and type install. Among the commands you should see Package Control: Install Package. If that command is not highlighted, use the keyboard or mouse to select it. There will be a pause of a few seconds while Package Control fetches the list of available plugins.

  2. When the plugin list appears, type phpcs. Among the entries you should see SublimeLinter-phpcs. If that entry is not highlighted, use the keyboard or mouse to select it.

Settings

For general information on how SublimeLinter works with settings, please see Settings. For information on generic linter settings, please see Linter Settings.

Project Specific Executable

It is possible to specify the phpcs executable that should be used to lint your code on a per-project level.

Example:

{
    "SublimeLinter": {
        "linters": {
            "phpcs": {
                "cmd": "${project}/vendor/bin/phpcs"
            }
        }
    }
}

Per-project Standards

You can set up your project settings to use a specific standard using the following:

{
    "SublimeLinter": {
        "linters": {
            "phpcs": {
                "standard": "${project}/phpcs.xml"
            }
        }
    }
}

Contributing

If you would like to contribute enhancements or fixes, please do the following:

  1. Fork the plugin repository.
  2. Hack on a separate topic branch created from the latest master.
  3. Commit and push the topic branch.
  4. Make a pull request.
  5. Be patient. ;-)

Please note that modications should follow these coding guidelines:

  • Indent is 4 spaces.
  • Code should pass flake8 and pep257 linters.
  • Vertical whitespace helps readability, don’t be afraid to use it.

Thank you for helping out!