From 16a0d477adb79d0db135dd7ff54e18d5fd5d9e9f Mon Sep 17 00:00:00 2001 From: herr kaste Date: Thu, 19 Apr 2018 15:14:31 +0200 Subject: [PATCH] Deprecate 'cmd' setting --- README.md | 17 ----------------- linter.py | 6 ++++++ messages.json | 3 ++- messages/1.2.1.txt | 14 ++++++++++++++ 4 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 messages/1.2.1.txt diff --git a/README.md b/README.md index 45b3812..712443f 100644 --- a/README.md +++ b/README.md @@ -19,23 +19,6 @@ To install `php`, download and run the appropriate installer: [Linux/OS X](http: Please make sure that the path to `php` is available to SublimeLinter. The docs cover [troubleshooting PATH configuration](http://sublimelinter.com/en/latest/troubleshooting.html#finding-a-linter-executable). -#### Specific Executable -It is possible to specify the `php` executable that should be used to lint your code, taking precedence over the executable available in your PATH. - -##### Example: - -```json -{ - "SublimeLinter": { - "linters": { - "php": { - "cmd": "/path/to/php" - } - } - } -} -``` - ## Settings diff --git a/linter.py b/linter.py index 79750d3..22b10d1 100644 --- a/linter.py +++ b/linter.py @@ -10,9 +10,13 @@ """This module exports the PHP plugin class.""" +import logging from SublimeLinter.lint import Linter, util +logger = logging.getLogger('SublimeLinter.plugin.eslint') + + class PHP(Linter): """Provides an interface to php -l.""" @@ -38,6 +42,8 @@ def cmd(self): settings = Linter.get_view_settings(self) if 'cmd' in settings: + logger.warning('The setting `cmd` has been deprecated. ' + 'Use `executable` instead.') command = [settings.get('cmd')] else: command = ['php'] diff --git a/messages.json b/messages.json index ac5ac4e..0ece4ac 100644 --- a/messages.json +++ b/messages.json @@ -1,4 +1,5 @@ { "install": "messages/install.txt", - "1.1.0": "messages/1.1.0.txt" + "1.1.0": "messages/1.1.0.txt", + "1.2.1": "messages/1.2.1.txt" } diff --git a/messages/1.2.1.txt b/messages/1.2.1.txt new file mode 100644 index 0000000..1fcd948 --- /dev/null +++ b/messages/1.2.1.txt @@ -0,0 +1,14 @@ +SublimeLinter-php 1.2.1 +--------------------------- + +The 'cmd' setting has been deprecated. The new name for the same thing is 'executable' which is the common name for all linters in SublimeLinter land. + +{ + "SublimeLinter": { + "linters": { + "php": { + "executable": "/path/to/php" + } + } + } +}