Permalink
Browse files

Initial commit of the PHP CodeSniffer Sublime Text 2 Plugin

  • Loading branch information...
0 parents commit 162d2456291181010e9ae9ebf536a5711db7ca43 @benmatselby committed Feb 9, 2012
Showing with 400 additions and 0 deletions.
  1. +10 −0 Context.sublime-menu
  2. +6 −0 Default.sublime-commands
  3. +29 −0 LICENSE.md
  4. +46 −0 Main.sublime-menu
  5. +35 −0 README.md
  6. +11 −0 Side Bar.sublime-menu
  7. +256 −0 phpcs.py
  8. +7 −0 phpcs.sublime-settings
@@ -0,0 +1,10 @@
+[
+ { "caption": "-" },
+ {
+ "caption": "PHP CodeSniffer",
+ "children":
+ [
+ { "command": "phpcs_sniff_this_file" }
+ ]
+ }
+]
@@ -0,0 +1,6 @@
+[
+ {
+ "caption": "PHP CodeSniffer: Sniff This File",
+ "command": "phpcs_sniff_this_file"
+ }
+]
@@ -0,0 +1,29 @@
+New BSD License
+===============
+
+Copyright (c) 2012, Ben Selby and contributors
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+* Neither the names of the copyright holders nor the names of its
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,46 @@
+[
+ {
+ "id": "tools",
+ "caption": "Tools",
+ "children":
+ [
+ {
+ "caption": "PHP CodeSniffer...",
+ "command": "show_overlay",
+ "args": {"overlay": "command_palette", "text": "PHP CodeSniffer: " }
+ }
+ ]
+ },
+ {
+ "caption": "Preferences",
+ "mnemonic": "n",
+ "id": "preferences",
+ "children":
+ [
+ {
+ "caption": "Package Settings",
+ "mnemonic": "P",
+ "id": "package-settings",
+ "children":
+ [
+ {
+ "caption": "PHP CodeSniffer",
+ "children":
+ [
+ {
+ "command": "open_file",
+ "args": {"file": "${packages}/Phpcs/phpcs.sublime-settings"},
+ "caption": "Settings – Default"
+ },
+ {
+ "command": "open_file",
+ "args": {"file": "${packages}/User/phpcs.sublime-settings"},
+ "caption": "Settings – User"
+ }
+ ]
+ }
+ ]
+ }
+ ]
+ }
+]
@@ -0,0 +1,35 @@
+Sublime PHP CodeSniffer
+=======================
+
+This plugin adds PHP CodeSniffer support to Sublime Text 2.
+
+Installation
+------------
+
+Use Sublime Text 2's [Package Control](http://wbond.net/sublime_packages/package_control) (Preferences -> Package Control -> Install Package -> PHP CodeSniffer) to install this plugin.
+
+PHP CodeSniffer Support For Sublime Text 2
+------------------------------------------
+
+This plugin adds support for running PHP CodeSniffer from inside Sublime Text 2.
+
+Right-click in the editor to:
+
+* Sniff the current file
+
+Right-click in the side-bar to:
+
+* Sniff all files in a folder
+
+You can also open up the Command Palette (CTRL + SHIFT + P on Linux), and type
+'PHP CodeSniffer' to see what you can do with PHP CodeSniffer in the currently open file.
+
+PHP CodeSniffer support is based on:
+[PHPUnit plugin](https://github.com/stuartherbert/sublime-phpunit) which is based on
+[Ruby Tests plugin](https://github.com/maltize/sublime-text-2-ruby-tests)_
+
+
+Contributions Welcome
+---------------------
+
+Requests for features, and pull requests with patches, are most welcome :)
@@ -0,0 +1,11 @@
+[
+ { "caption": "-" },
+ {
+ "caption": "PHP CodeSniffer",
+ "children":
+ [
+ { "command": "phpcs_sniff_this_file", "args": { "paths": [] } },
+ { "command": "phpcs_sniff_all_files", "args": { "paths": [] } }
+ ]
+ }
+]
Oops, something went wrong.

0 comments on commit 162d245

Please sign in to comment.