Skip to content

Commit 2a1bc16

Browse files
author
Mark Collins
committed
Initial commit
0 parents  commit 2a1bc16

File tree

8 files changed

+146
-0
lines changed

8 files changed

+146
-0
lines changed

.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Compiled source #
2+
###################
3+
*.com
4+
*.class
5+
*.dll
6+
*.exe
7+
*.o
8+
*.so
9+
10+
# Packages #
11+
############
12+
# it's better to unpack these files and commit the raw source
13+
# git has its own built in compression methods
14+
*.7z
15+
*.dmg
16+
*.gz
17+
*.iso
18+
*.jar
19+
*.rar
20+
*.tar
21+
*.zip
22+
23+
# Logs and databases #
24+
######################
25+
*.log
26+
*.sql
27+
*.sqlite
28+
29+
# OS generated files #
30+
######################
31+
.DS_Store
32+
.DS_Store?
33+
._*
34+
.Spotlight-V100
35+
.Trashes
36+
ehthumbs.db
37+
Thumbs.db
38+
39+
# Node installed packages #
40+
###########################
41+
node_modules/*

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
language: python
2+
python:
3+
- "3.6"
4+
install:
5+
- pip install flake8
6+
script:
7+
- flake8 . --max-line-length=120

HOWTO.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Creating a Linter Plugin
2+
========================
3+
4+
- Click "use this template" to bootstrap your new linter.
5+
- Clone it into Packages.
6+
- Change a linter.py.
7+
- Update the README and replace `__linter__` placeholders.
8+
- Update messages/install.txt and replace `__linter__` placeholders.
9+
- Open a PR in our [package_control repo](https://github.com/SublimeLinter/package_control_channel) to make it available to others.
10+
11+
Additional documentation can be found at [sublimelinter.com](http://sublimelinter.com).
12+
13+
14+
Updating class attributes
15+
--------------------------
16+
Template linter plugins are created with almost all of the Linter class attributes filled in with the default values. To make your new linter plugin functional, at the very least you need to do the following:
17+
18+
- Change the default `'selector'` to include the scopes you want the linter to lint.
19+
20+
- Change the `cmd` attribute to include the executable and arguments you want to include on *every* run. Usually this should be a tuple like `('linter', '-fooarg', '-etc', '-')`. You can also make `cmd` a method (or callable in python speak) which returns such a tuple.
21+
22+
- Change the `regex` attribute to correctly capture the error output from the linter.
23+
24+
- Change the `multiline` attribute to `True` if the regex parses multiline error messages.
25+
26+
Other, optional, attributes include:
27+
28+
- If the linter executable does not accept input via `stdin`, set the `tempfile_suffix` attribute to the filename suffix of the temp files that will be created.
29+
30+
- If the linter outputs errors only on `stderr` or `stdout`, set `error_stream` to `util.STREAM_STDERR` or `util.STREAM_STDOUT` respectively.
31+
32+
You should remove attributes that you do not change, as their values will be provided by the superclass. More information can be found in the [docs](https://github.com/SublimeLinter/SublimeLinter/blob/master/docs/linter_attributes.rst).

LICENSE

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Permission is hereby granted, free of charge, to any person obtaining a copy
2+
of this software and associated documentation files (the "Software"), to deal
3+
in the Software without restriction, including without limitation the rights
4+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
5+
copies of the Software, and to permit persons to whom the Software is
6+
furnished to do so, subject to the following conditions:
7+
8+
The above copyright notice and this permission notice shall be included in
9+
all copies or substantial portions of the Software.
10+
11+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
17+
THE SOFTWARE.

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
This is a template. For "how to make a linter", please check [the HOWTO](HOWTO.md).
2+
3+
-----------------------------------------------------------------
4+
5+
SublimeLinter-contrib-__linter__
6+
================================
7+
8+
[![Build Status](https://travis-ci.org/SublimeLinter/SublimeLinter-contrib-__linter__.svg?branch=master)](https://travis-ci.org/SublimeLinter/SublimeLinter-contrib-__linter__)
9+
10+
This linter plugin for [SublimeLinter](https://github.com/SublimeLinter/SublimeLinter) provides an interface to [__linter__](__linter_homepage__). It will be used with files that have the “__syntax__” syntax.
11+
12+
## Installation
13+
SublimeLinter must be installed in order to use this plugin.
14+
15+
Please use [Package Control](https://packagecontrol.io) to install the linter plugin.
16+
17+
Before installing this plugin, you must ensure that `__linter__` is installed on your system.
18+
19+
In order for `__linter__` to be executed by SublimeLinter, you must ensure that its path is available to SublimeLinter. The docs cover [troubleshooting PATH configuration](http://sublimelinter.readthedocs.io/en/latest/troubleshooting.html#finding-a-linter-executable).
20+
21+
## Settings
22+
- SublimeLinter settings: http://sublimelinter.readthedocs.org/en/latest/settings.html
23+
- Linter settings: http://sublimelinter.readthedocs.org/en/latest/linter_settings.html
24+
25+
Additional SublimeLinter-__linter__ settings:
26+
27+
|Setting|Description |
28+
|:------|:--------------|
29+
|foo |Something. |
30+
|bar |Something else.|

linter.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from SublimeLinter.lint import Linter # or NodeLinter, PythonLinter, ComposerLinter, RubyLinter
2+
3+
4+
class __class__(Linter):
5+
cmd = '__cmd__'
6+
regex = r''
7+
multiline = False
8+
defaults = {
9+
'selector': 'source.python'
10+
}

messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"install": "messages/install.txt"
3+
}

messages/install.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
SublimeLinter-contrib-__linter__
2+
-------------------------------
3+
This linter plugin for SublimeLinter provides an interface to __linter__.
4+
5+
For more information, please see:
6+
https://github.com/__user__/SublimeLinter-contrib-__linter__

0 commit comments

Comments
 (0)