Sublimelinter Documentation Release 3.4.24
Total Page:16
File Type:pdf, Size:1020Kb
SublimeLinter Documentation Release 3.4.24 The SublimeLinter Community Mar 06, 2018 Contents 1 Support 3 2 Be Part of the Team 5 3 User Documentation 7 3.1 About SublimeLinter...........................................7 3.1.1 What is a linter?.........................................7 3.1.2 Why do I need a linter?.....................................7 3.2 Installation................................................8 3.2.1 Upgrading from previous versions...............................8 3.2.2 Installing via Package Control.................................8 3.2.3 Installing from source......................................9 3.2.4 Linter plugins..........................................9 3.2.5 Read the docs!......................................... 10 3.3 Usage................................................... 10 3.3.1 Startup actions......................................... 10 3.3.2 Assigning linters........................................ 10 3.3.3 Linting............................................. 10 3.3.4 How linter executables are located............................... 11 3.3.5 Disabling all linters....................................... 11 3.3.6 Toggling linters......................................... 12 3.3.7 Choosing color schemes.................................... 12 3.3.8 User interface.......................................... 12 3.4 Lint Modes................................................ 13 3.4.1 The modes........................................... 13 3.4.2 Choosing a lint mode...................................... 14 3.4.3 Manually linting........................................ 15 3.4.4 Showing errors on save..................................... 15 3.5 Mark Styles................................................ 15 3.5.1 Status bar info.......................................... 16 3.5.2 Code mark styles........................................ 16 3.5.3 Choosing a mark style..................................... 18 3.5.4 No-column mode........................................ 19 3.6 Gutter Themes.............................................. 19 3.6.1 Gutter theme structure..................................... 19 3.6.2 Standard gutter themes..................................... 19 3.6.3 Choosing a gutter theme.................................... 20 i 3.6.4 Creating a gutter theme..................................... 20 3.7 Navigating Errors............................................ 21 3.7.1 Accessing navigation commands................................ 22 3.7.2 Showing all errors........................................ 22 3.7.3 Making warnings passive.................................... 22 3.8 Settings.................................................. 23 3.8.1 Settings stack.......................................... 23 3.8.2 Setting types.......................................... 23 3.8.3 Settings sources......................................... 24 3.8.4 Setting tokens.......................................... 30 3.9 Global Settings.............................................. 31 3.9.1 debug.............................................. 31 3.9.2 delay.............................................. 31 3.9.3 error_color........................................... 31 3.9.4 gutter_theme.......................................... 31 3.9.5 gutter_theme_excludes..................................... 31 3.9.6 lint_mode............................................ 32 3.9.7 mark_style........................................... 32 3.9.8 no_column_highlights_line................................... 32 3.9.9 passive_warnings........................................ 32 3.9.10 paths............................................... 32 3.9.11 python_paths.......................................... 33 3.9.12 rc_search_limit......................................... 33 3.9.13 shell_timeout.......................................... 33 3.9.14 show_errors_on_save...................................... 33 3.9.15 show_marks_in_minimap.................................... 33 3.9.16 syntax_map........................................... 33 3.9.17 warning_color.......................................... 34 3.9.18 wrap_find............................................ 34 3.10 Meta Settings............................................... 34 3.10.1 @disable............................................ 34 3.10.2 @python............................................ 35 3.10.3 Resolving python versions................................... 35 3.10.4 Version matching........................................ 36 3.11 Linter Settings.............................................. 36 3.11.1 @disable............................................ 36 3.11.2 args............................................... 36 3.11.3 chdir............................................... 37 3.11.4 excludes............................................. 37 3.11.5 ignore_match.......................................... 38 3.12 Troubleshooting............................................. 39 3.12.1 Console output......................................... 39 3.12.2 Debug mode........................................... 39 3.12.3 The linter doesn’t work!.................................... 40 3.12.4 Use the group, Luke...................................... 40 3.12.5 Debugging PATH problems................................... 40 3.12.6 Debugging python-based linters................................ 44 4 Developer Documentation 47 4.1 Creating a Linter Plugin......................................... 47 4.1.1 Creating a template plugin................................... 47 4.1.2 Coding guidelines........................................ 48 4.1.3 Updating class attributes.................................... 48 4.1.4 Updating documentation.................................... 49 ii 4.1.5 Preparing for publication.................................... 49 4.2 Linter Attributes............................................. 50 4.2.1 cmd............................................... 50 4.2.2 comment_re........................................... 50 4.2.3 config_file............................................ 51 4.2.4 default_type........................................... 51 4.2.5 defaults............................................. 51 4.2.6 error_stream........................................... 54 4.2.7 executable............................................ 56 4.2.8 inline_overrides......................................... 56 4.2.9 inline_settings.......................................... 56 4.2.10 line_col_base.......................................... 56 4.2.11 multiline............................................. 56 4.2.12 re_flags............................................. 57 4.2.13 regex.............................................. 57 4.2.14 selectors............................................. 59 4.2.15 shebang_match......................................... 59 4.2.16 syntax.............................................. 59 4.2.17 tempfile_suffix......................................... 60 4.2.18 version_args........................................... 61 4.2.19 version_re............................................ 61 4.2.20 version_requirement...................................... 61 4.2.21 word_re............................................. 62 4.3 Linter Methods.............................................. 62 4.3.1 build_options.......................................... 62 4.3.2 can_lint_syntax......................................... 62 4.3.3 cmd............................................... 63 4.3.4 communicate.......................................... 63 4.3.5 get_view_settings........................................ 63 4.3.6 run................................................ 63 4.3.7 split_match........................................... 64 4.3.8 tmpdir.............................................. 64 4.3.9 tmpfile.............................................. 64 4.3.10 which.............................................. 65 4.4 PythonLinter class............................................ 65 4.4.1 check (method)......................................... 65 4.4.2 check_version (class attribute)................................. 66 4.4.3 cmd (class attribute)....................................... 66 4.4.4 module (class attribute)..................................... 67 4.5 RubyLinter class............................................. 67 4.5.1 rbenv and rvm support..................................... 68 4.6 Contributing............................................... 68 4.6.1 Coding guidelines........................................ 69 4.7 Acknowledgements........................................... 69 iii iv SublimeLinter Documentation, Release 3.4.24 SublimeLinter is a plugin for Sublime Text 3 that provides a framework for linting code. Whatever language you code in, SublimeLinter can help you write cleaner, better, more bug-free code. SublimeLinter has been designed to provide maximum flexibility and usability for users and maximum simplicity for linter authors. The documentation for SublimeLinter is divided into two sections: one for users, and one for developers who would like to create their own linter plugins. User Documentation | Developer Documentation The SublimeLinter source is available on github. Contents 1 SublimeLinter Documentation, Release 3.4.24 2 Contents CHAPTER 1 Support Please use the SublimeLinter issue tracker for support and bug reporting but before opening a new ticket, verify there isn’t already a ticket in the SublimeLinter issue tracker or the now deprecated SublimeLinter google