Skip to content

Commit

Permalink
Merge pull request #14 from SublimeLinter/sl4-cleanup
Browse files Browse the repository at this point in the history
cleanup for SL4
  • Loading branch information
braver authored Apr 2, 2018
2 parents 78d6ab6 + 6f4d1a5 commit 7bbfa24
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 62 deletions.
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
language: python
python:
- "3.3"
# command to install dependencies
- "3.6"
install:
- pip install flake8
- pip install pydocstyle
# command to run tests
script:
- flake8 . --max-line-length=120
- pydocstyle . --add-ignore=D202
35 changes: 14 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ SublimeLinter-phpmd

[![Build Status](https://travis-ci.org/SublimeLinter/SublimeLinter-phpmd.svg?branch=master)](https://travis-ci.org/SublimeLinter/SublimeLinter-phpmd)

This linter plugin for [SublimeLinter](https://github.com/SublimeLinter/SublimeLinter) provides an interface to [phpmd](http://phpmd.org/documentation/index.html). It will be used with files that have the “PHP”, “HTML” and “HTML5” syntax.
This linter plugin for [SublimeLinter](https://github.com/SublimeLinter/SublimeLinter) provides an interface to [phpmd](http://phpmd.org/documentation/index.html).
It will be used with files that have the "PHP", "HTML" and "HTML5" syntax.


## Installation

SublimeLinter must be installed in order to use this plugin.

Please use [Package Control](https://packagecontrol.io) to install the linter plugin.

Before installing this plugin, you must ensure that `phpmd` is installed on your system. To install `phpmd`, do the following:
Before installing this plugin, ensure that `phpmd` is installed on your system.
To install `phpmd`, do the following:

1. Install [php](http://php.net).

Expand All @@ -23,7 +27,8 @@ Before installing this plugin, you must ensure that `phpmd` is installed on your
pear install --alldeps phpmd/PHP_PMD
```

#### Alternative installation using [composer](https://getcomposer.org/):
### Alternative installation using [composer](https://getcomposer.org/):

1. Install [composer](https://getcomposer.org/).
2. Install `phpmd` using below command:
```
Expand All @@ -34,22 +39,10 @@ composer global require phpmd/phpmd
export PATH=~/.composer/vendor/bin:$PATH
```


## Settings
- SublimeLinter settings: http://sublimelinter.readthedocs.org/en/latest/settings.html
- Linter settings: http://sublimelinter.readthedocs.org/en/latest/linter_settings.html

### 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:**
```json
{
"SublimeLinter": {
"linters": {
"phpmd": {
"cmd": "${folder}/vendor/bin/phpmd"
}
}
}
}
```

- SublimeLinter settings: http://sublimelinter.com/en/latest/settings.html
- Linter settings: http://sublimelinter.com/en/latest/linter_settings.html


18 changes: 2 additions & 16 deletions linter.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Dmitry Tsoy
# Copyright (c) 2013 Dmitry Tsoy
#
# License: MIT
#

"""This module exports the Phpmd plugin class."""

from SublimeLinter.lint import Linter, WARNING


class Phpmd(Linter):
"""Provides an interface to phpmd."""

syntax = ('php', 'html', 'html 5')
cmd = ('phpmd', '@', 'text')
cmd = ('phpmd', '${file}', 'text')
regex = (
r'(?P<filename>.+):(?P<line>\d+)'
r'\s*(?P<message>.+)$'
)
default_type = WARNING
tempfile_suffix = 'php'
defaults = {
'selector': 'source.php, text.html.basic',
'@rulesets:,': 'cleancode,codesize,controversial,design,naming,unusedcode'
}
3 changes: 1 addition & 2 deletions messages.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"install": "messages/install.txt",
"1.1.0": "messages/1.1.0.txt"
"install": "messages/install.txt"
}
17 changes: 0 additions & 17 deletions messages/1.1.0.txt

This file was deleted.

3 changes: 2 additions & 1 deletion messages/install.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ SublimeLinter-phpmd

This linter plugin for SublimeLinter provides an interface to phpmd.

For more information, please see https://github.com/SublimeLinter/SublimeLinter-phpmd.
For more information, please see
https://github.com/SublimeLinter/SublimeLinter-phpmd.

0 comments on commit 7bbfa24

Please sign in to comment.