How to Start using Linter on Sublime Text

Haydar Ali Ismail
4 min readJan 7, 2017

--

This story is a follow-up to the previous story about code style in the link below.

Sublime Text is one of the most popular text editor right now (yeah I know, Atom and VSCode also quite popular right now). Some people prefer to use Text Editor rather than a full-fledged IDE. But, one of the problems with most text editors are that they didn’t come with out-of-the-box syntax error markers or style code checker. Don’t worry, we have solutions for Text Editor maniac.

Linter

As in Wikipedia, lint or a linter is any tool that flags suspicious usage in software written in any computer languages. Yet, the definition of lint today is often used to represents as checkers whether the code corresponds to certain code style or not. It is also useful for simple debuggers for common errors.

Installation

Package Control

To install Linter on our Sublime Text, we have to install Package Control first. Basically, Package Control is a package manager designed for Sublime Text to install and keep packages up-to-date. To check for installation instruction, you can always check on the link below. It will run several python codes, I can’t copy the content of the code here since it will change over time.

Running code to install Package Control

SublimeLinter

If you have installed the package manager, you can start to install packages, yeaay. To install packages in sublime, open the command palette (ctrl+shift+p for Windows and Linux or cmd+shift+p for Mac OS X). Type install and select Package Control: Install Package from the command palette.

Install Package

Now, you will be given a list of available packages. Search for SublimeLinter and now select from the command palette.

Select SublimeLinter

Wait for a few seconds, and SublimeLinter will be installed!

Linter for specific programming languages

Open command palette again and you will see there are tons of available linter out there, now you should install which one you want to use.

Linter packages

For demonstration, I’m going to install the linter for Python with PEP8 code style. So we select the SublimeLinter-pep8.

Installing SublimeLinter for pep8

Usually after this you will need to do more configuration, just check for the message that pops out after the linter installation completed and complete the instruction.

Example of further instruction for SublimeLinter-pep8

Usages

Now it’s all done! You can use it right away. Here is an example of checking python code using SublimeLinter-pep8.

Example of linter in action

Wrap Up

So, that’s all you need to do to configure linter in Sublime Text. Let me know if you have something in mind or suggestion for me. You can even request me to cover up some topic. Hopefully, it will help you in any way. Happy coding!

--

--