Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
idleberg committed Sep 17, 2018
0 parents commit 45838b5
Show file tree
Hide file tree
Showing 6 changed files with 140 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
todo.md
19 changes: 19 additions & 0 deletions .sublimelinterrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"@python": 3,
"linters": {
"flake8": {
"max-line-length": 120
},
"pep257": {
"ignore": ["D202"]
},
"pep8": {
"max-line-length": 120
},
"brew":
{
"selector": "source.ruby"
}
}
}
}
21 changes: 21 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
sudo: false
git:
depth: 1
branches:
only:
- master
language: python
python:
- "3.4"
- "3.5"
- "3.6"
# command to install dependencies
install:
- pip install flake8
- pip install pep257
# command to run tests
script:
- flake8 . --max-line-length=120 --ignore=D211
- pep257 . --ignore=D202,D211
notifications:
email: false
17 changes: 17 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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.
54 changes: 54 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
SublimeLinter-contrib-brew
==========================

[![The MIT License](https://img.shields.io/badge/license-MIT-orange.svg?style=flat-square)](http://opensource.org/licenses/MIT)
[![Package Control](https://packagecontrol.herokuapp.com/downloads/SublimeLinter-contrib-brew.svg?style=flat-square)](https://packagecontrol.io/packages/SublimeLinter-contrib-brew)
[![GitHub](https://img.shields.io/github/release/idleberg/SublimeLinter-contrib-brew.svg?style=flat-square)](https://github.com/idleberg/SublimeLinter-contrib-brew/releases)
[![Travis CI](https://img.shields.io/travis/idleberg/SublimeLinter-contrib-brew/master.svg?style=flat-square)](https://travis-ci.org/idleberg/SublimeLinter-contrib-brew)

This linter plugin for [SublimeLinter][docs] provides an interface to [brew](https://brew.sh/). It will be used with Homebrew formulas.

## 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 Homebrew is installed on your system. Visit the developer's [website](https://brew.sh/) and follow the installation steps.

### Linter configuration
In order for `brew` to be executed by SublimeLinter, you must [ensure that its path is available][path] 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 `brew`, you can proceed to install the SublimeLinter-contrib-brew 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 `brew`. Among the entries you should see `SublimeLinter-contrib-brew`. If that entry is not highlighted, use the keyboard or mouse to select it.

## 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
[path]: http://superuser.com/a/284351/195953
[pc]: https://sublime.wbond.net/installation
[cmd]: http://docs.sublimetext.info/en/sublime-text-3/extensibility/command_palette.html
28 changes: 28 additions & 0 deletions linter.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# linter.py
# Linter for SublimeLinter3, a code checking framework for Sublime Text 3
#
# Written by Jan T. Sott
# Copyright (c) 2018 Jan T. Sott
#
# https://github.com/idleberg/SublimeLinter-contrib-brew
#
# License: MIT
#

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

from SublimeLinter.lint import Linter


class Brew(Linter):

"""Provides an interface to the Brew executable."""

cmd = ('brew', 'audit', '--strict', '--display-filename', '${file}')
syntax = 'ruby'
regex = (
r'^(?P<file>.+): \* C: (?P<line>\d+): col (?P<col>\d+): (?P<message>.+)$'
)
multiline = False
line_col_base = (1, 1)

0 comments on commit 45838b5

Please sign in to comment.