Skip to content

Commit

Permalink
initial commit. Handles warnings and errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
Xenhat Liamano committed Apr 20, 2016
0 parents commit 164b67e
Show file tree
Hide file tree
Showing 10 changed files with 2,181 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
.DS_Store
14 changes: 14 additions & 0 deletions .sublimelinterrc
@@ -0,0 +1,14 @@
{
"@python": 3,
"linters": {
"flake8": {
"max-line-length": 120
},
"pep257": {
"add-ignore": ["D202"]
},
"pep8": {
"max-line-length": 120
}
}
}
11 changes: 11 additions & 0 deletions .travis.yml
@@ -0,0 +1,11 @@
language: python
python:
- "3.3"
# command to install dependencies
install:
- pip install flake8
- pip install pep257
# command to run tests
script:
- flake8 . --max-line-length=120
- pep257 . --add-ignore=D202
17 changes: 17 additions & 0 deletions LICENSE
@@ -0,0 +1,17 @@
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
73 changes: 73 additions & 0 deletions README.md
@@ -0,0 +1,73 @@
SublimeLinter-contrib-lslint
================================

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

This linter plugin for [SublimeLinter][docs] provides an interface to [lslint](__linter_homepage__). It will be used with files that have the “__syntax__” syntax.

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

### Linter installation
Before using this plugin, you must ensure that `lslint` is installed on your system. To install `lslint`, do the following:

1. Install Other.

1. Install `lslint` by typing the following in a terminal:
```
<package manager> install lslint
```


**Note:** This plugin requires `lslint` __version__ or later.

### Linter configuration
In order for `lslint` to be executed by SublimeLinter, you must ensure that its path is available to SublimeLinter. Before going any further, please read and follow the steps in [“Finding a linter executable”](http://sublimelinter.readthedocs.org/en/latest/troubleshooting.html#finding-a-linter-executable) through “Validating your PATH” in the documentation.

Once you have installed and configured `lslint`, you can proceed to install the SublimeLinter-contrib-lslint plugin if it is not yet installed.

### Plugin installation
Please use [Package Control][pc] 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][cmd] 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.

1. When the plugin list appears, type `lslint`. Among the entries you should see `SublimeLinter-contrib-lslint`. 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][settings]. For information on generic linter settings, please see [Linter Settings][linter-settings].

In addition to the standard SublimeLinter settings, SublimeLinter-contrib-lslint provides its own settings. Those marked as “Inline Setting” or “Inline Override” may also be [used inline][inline-settings].

|Setting|Description|Inline Setting|Inline Override|
|:------|:----------|:------------:|:-------------:|
|foo|Something.|&#10003;| |
|bar|Something else.| |&#10003;|

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

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

Please note that modifications 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.
- Please use descriptive variable names, no abbreviations unless they are very well known.

Thank you for helping out!

[docs]: http://sublimelinter.readthedocs.org
[installation]: http://sublimelinter.readthedocs.org/en/latest/installation.html
[locating-executables]: http://sublimelinter.readthedocs.org/en/latest/usage.html#how-linter-executables-are-located
[pc]: https://sublime.wbond.net/installation
[cmd]: http://docs.sublimetext.info/en/sublime-text-3/extensibility/command_palette.html
[settings]: http://sublimelinter.readthedocs.org/en/latest/settings.html
[linter-settings]: http://sublimelinter.readthedocs.org/en/latest/linter_settings.html
[inline-settings]: http://sublimelinter.readthedocs.org/en/latest/settings.html#inline-settings
36 changes: 36 additions & 0 deletions linter.py
@@ -0,0 +1,36 @@
#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by xenhat
# Copyright (c) 2016 xenhat
#
# License: MIT
#

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

from SublimeLinter.lint import Linter, util


class Lslint(Linter):
"""Provides an interface to lslint."""

syntax = 'lsl'
# cmd = 'lslint -p'
cmd = 'lslint'
executable = None
version_args = '-V'
version_re = r'(?P<version>\d+\.\d+\.\d+)'
version_requirement = '>= 0.4.2'
regex = r'((?P<warning> WARN)|(?P<error>ERROR))\:\:\s\(\s+(?P<line>\d+),\s+(?P<col>\d+)\)\:\s(?P<message>.*)'
multiline = False
line_col_base = (1, 1)
tempfile_suffix = 'lsl'
error_stream = util.STREAM_BOTH
selectors = {}
word_re = None
defaults = {}
inline_settings = None
inline_overrides = None
comment_re = None
Binary file added linter.pyc
Binary file not shown.

0 comments on commit 164b67e

Please sign in to comment.