BBEdit & Code Analysis Integration

BBEdit & Code Analysis Integration

Overview


BBEdit is primarily designed for use by software & script developers, web designers, etc. It has native support for many programming languages and custom modules can be created by users to support any language. The application contains multi-file text searching capabilities including support for regular expressions. BBEdit allows previewing and built-in validation of HTML markup and also provides a model for most HTML code that can be entered into a dialog box.

It also includes FTP and SFTP tools and integrates with code management systems. It can show differences between file versions and allows for the merging of changes. Support for version control, including Git, Perforce, and Subversion is built into the program.

In our environment and group, BBEdit is one of our favorite text editors that we use for multiple functions from viewing editing radmind transcript & command files, property list & configuration profile files, JSON/XML files, code development, markdown/web development, etc.

For integrating code analysis & checking it’s not as easy or straight forward as some other text editor options like Atom, Sublime Text or TextMate, etc.

We hope this improves in the future, but in the meantime, you can get support for your favorite tools using an option with scripts in BBEdit which can be executable Unix files, AppleScript files, text factories, or Automator workflows. These are run simply by loading the item and calling it directly, without providing any inputs. For example, BBEdit’s Script Menu feature allows you to add your own scripts that can allow customization and additional code analysis integration.

 

Details


Shellcheck

ShellCheck is an analysis tool that shows warnings and suggestions concerning bad code in bash/sh shell scripts. It can be used in several ways: from the web by pasting your shell script in an online editor. Or you can install it on your machine and run it from the terminal, integrate it with your text editor as well as in your build or test suites.

Shellcheck – Installation
For macOS, you have three options for ShellCheck. One option is compiling from the source.

Two, install locally through a package manager like brew.

Or better you can download pre-compiled binaries for the latest release from the Github repository here.

Shellcheck – BBEdit AppleScript Integration
Download the following AppleScript and save it in your users home folder here:

 

Pylint

Pylint is a source-code, bug and quality checker for the Python programming language. It is named following a common convention in Python of a “py” prefix, and a nod to the C programming lint program. It follows the style recommended by PEP 8, the Python style guide.

Pylint Logo 2018.svg

Pylint – Installation
To install pylint on macOS, run the following command:

Pylint – BBEdit Integration
Download the following AppleScript and save it in your users home folder here:

 

Flake8

Flake8 is a wrapper around the tools, PyFlakes (fast static analysis), pycodestyle (checking the style) and Ned Batchelder’s McCabe script to find code that is too complex and needs refactoring. It is a great toolkit for checking your code base against coding style (PEP8), programming errors (like “library imported but unused” and “Undefined name”) and to check code complexity.

Image result for python cyclomatic complexity

Flack8 – Installation

To install Flake8, open an interactive shell and run:

Flake8 –  BBEdit Integration

Download the following AppleScript and save it in your users home folder here:

 

No Comments

Leave a Reply