Giter Club home page Giter Club logo

sublimelinter-contrib-sublime-syntax's Introduction

SublimeLinter-contrib-sublime-syntax

This linter plugin for SublimeLinter provides an interface to Sublime Text's internal syntax testing engine. It will be used on files that define syntax tests for Sublime Text (i.e. files starting with syntax_test).

screenshot

Notice: This linter relies on undocumented and unpublic API of Sublime Text and may break on any new Sublime Text release.

You must be using Sublime Text Build 3092 or higher in order to install and use this linter.

Installation

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

Plugin installation

Please use Package Control 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 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.

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

Contributing

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

  1. Fork the plugin repository.
  2. Hack on a separate topic branch created from the latest master.
  3. Commit and push the topic branch.
  4. Make a pull request.
  5. 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!

sublimelinter-contrib-sublime-syntax's People

Contributors

fichtefoll avatar kaste avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sublimelinter-contrib-sublime-syntax's Issues

Lint is failing

SublimeLinter: linter.py:931          sublimesyntax: checking lint mode 'background' vs lint reason 'on_user_request'
SublimeLinter: #412 linter.py:948     sublimesyntax: linting 'syntax_test_c.c'
SublimeLinter: sublime-syntax: created temporary file at /usr/local/home/me/.config/sublime-text-3/Packages/.temp-subsyn-lint/syntax_test_jct7ou 
SublimeLinter: sublime-syntax: "syntax_test_c.c" assertions: 1 
SublimeLinter: #412 linter.py:1027    sublimesyntax: output:
  Packages/.temp-subsyn-lint/syntax_test_jct7ou: unable to read file
SublimeLinter: #412 linter.py:1063    sublimesyntax: No match for line: 'Packages/.temp-subsyn-lint/syntax_test_jct7ou: unable to read file'
SublimeLinter: sublime_linter.py:449  Linting 'syntax_test_c.c' took 0.01s

SublimeLinter v4.9.4
SublimeLinter-contrib-sublime-syntax v1.1.0
Sublime Text v3192

UnicodeEncodeError

On Windows 10 with ST v3109 I get a Unicode Encode Error when linting the CSS syntax test from sublimehq/Packages

Seems the tempfile's contents aren't being written as UTF8

Stack trace:

Traceback (most recent call last):
  File "C:\Sublime Syntax Test\Data\Packages\SublimeLinter\lint\queue.py", line 65, in loop
    self.lint(view_id, timestamp)
  File "C:\Sublime Syntax Test\Data\Packages\SublimeLinter\lint\queue.py", line 111, in lint
    self.callback(view_id, timestamp)
  File "C:\Sublime Syntax Test\Data\Packages\SublimeLinter\sublimelinter.py", line 119, in lint
    Linter.lint_view(view, filename, code, hit_time, callback)
  File "C:\Sublime Syntax Test\Data\Packages\SublimeLinter\lint\linter.py", line 929, in lint_view
    linter.lint(hit_time)
  File "C:\Sublime Syntax Test\Data\Packages\SublimeLinter\lint\linter.py", line 1397, in lint
    output = self.run(cmd, self.code)
  File "linter in C:\Sublime Syntax Test\Data\Installed Packages\SublimeLinter-contrib-sublime-syntax.sublime-package", line 66, in run
  File "./python3.3/contextlib.py", line 48, in __enter__
  File "linter in C:\Sublime Syntax Test\Data\Installed Packages\SublimeLinter-contrib-sublime-syntax.sublime-package", line 137, in _temporary_resource_file
  File "./python3.3/encodings/cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f600' in position 22375: character maps to <undefined>

CSS @import Breaks Linting

On Windows 10 with ST v3109 when the linter encounters the CSS import at-rule, the import at-rule meta scope becomes the scope all following assertions are tested against.

Take the following example:

    @import;    /* meta.at-rule.import.css */

    html {}    /* correctly scoped as entity.name.tag.css */
/*  ^^^^ entity.name.tag.css */

The resulting output is:

[entity.name.tag.css] does not match scope [source.css meta.at-rule.import.css]
[entity.name.tag.css] does not match scope [source.css meta.at-rule.import.css]
[entity.name.tag.css] does not match scope [source.css meta.at-rule.import.css]
[entity.name.tag.css] does not match scope [source.css meta.at-rule.import.css]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.