Skip to content

Commit

Permalink
Merge pull request #41 from SublimeLinter/deprecate-cmd-setting
Browse files Browse the repository at this point in the history
Deprecate 'cmd' setting
  • Loading branch information
kaste authored Apr 20, 2018
2 parents 8610a2c + 16a0d47 commit 0887237
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand All @@ -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']
Expand Down
3 changes: 2 additions & 1 deletion messages.json
Original file line number Diff line number Diff line change
@@ -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"
}
14 changes: 14 additions & 0 deletions messages/1.2.1.txt
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}

0 comments on commit 0887237

Please sign in to comment.