shipshape

module
v0.0.0-...-2435b8f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2019 License: Apache-2.0

README

Shipshape is not actively maintained. The GitHub project has been archived.

Overview of Shipshape

Last updated: 2016-08-29

Build Status

Shipshape is a static program analysis platform that allows custom analyzers to plug in through a common interface. Shipshape is packaged in a docker image. When that image is run, a Shipshape analyzer service starts up and processes analysis requests. Structured analysis results are generated. Shipshape can be run as a command-line interface, or as a Jenkins plugin. The requirements to run are that you are running Linux with docker installed and the source code you want to analyze available on disk.

The source code for Shipshape is located in the "shipshape" directory. Third-party libraries used by Shipshape are all in the "third_party" directory.

Download and Run Shipshape

Shipshape has been tested on Ubuntu (>=14.04) and Debian unstable, but should work on other Linux distributions.

Shipshape requires Docker to run.

Install instructions for Linux.

Install instructions for GCE.

Once you've installed it, running is easy!

$ shipshape <Directory>

For examples for how to use it, see our documentation.

Building from source

Shipshape uses the Bazel build tool. Once you have Docker and Bazel installed, you can build Shipshape with:

$ ./configure
$ bazel build //...

The binary will be saved in bazel-bin/shipshape/cli/shipshape.

Analyzers

The following analyzers are bundled with Shipshape:

Contributed analyzers

The following analyzers were contributed by external developers:

  • AndroidLint. Image: gcr.io/shipshape_releases/android_lint:prod
  • CTADetector - Yu Lin (University of Illinois at Urbana-Champaign). Image: yulin2/ctadetector
  • ExtendJ - Jesper Öqvist (Lund University). Image: joqvist/extendj_shipshape
Add a new analyzer

See our documentation on how to create more analyzers of your own. We also have a complete example.

Contributing to shipshape

To contribute to shipshape, first read our contribution guidelines and then make sure you can build and run shipshape from source.

Running the Jenkins Plugin

Instructions are located in shipshape/jenkins_plugin/README.md.

Package Structure of Shipshape

analyzers -- implementation for several simple analyzers run by the go_dispatcher. The canonical simplest analyzer is in analyzers/postmessage

androidlint_analyzer -- implementation for AndroidLint packaged as a complete Shipshape analyzer service, using libraries from the service package

api -- go API used by analyzers running under the go_dispatcher

cli -- code for the CLI that pulls down a Shipshape service, starts it running on a specified directory, and outputs analysis results

docker -- Dockerfiles for the various docker packages produced by Shipshape

java -- code for a javac dispatcher analyzer service that runs analyzers that build off of javac

jenkins_plugin -- code for the jenkins plugin that runs Shipshape

proto -- the protocol buffer APIs for writing new analyzers. Shipshape analyzers are services that implement the rpcs listed in the ShipshapeService interface in proto/shipshape_rpc.proto. Analyzers produce structured output in the form of Note messages, defined in proto/note.proto

service -- core Shipshape code. go_dispatcher -- dispatching Shipshape analyzer service for the go language. calls out to analyzers in the analyzer package. shipshape -- main shipshape service loop driver -- controller for calling out to all passed in analyzer services (including the go_dispatcher and the javac_analyzer) config -- processes .shipshape config files to determine which analyzers run

test -- manual integration tests to simplify the process of running Shipshape locally on test input, useful when developing new analyzer services

util -- various go utilities that simplify Shipshape code, e.g. for working with slices, execing docker commands, or writing tests

Directories

Path Synopsis
shipshape
analyzers/govet
Package govet implements a Shipshape analyzer that runs go vet over all Go files in the given ShipshapeContext.
Package govet implements a Shipshape analyzer that runs go vet over all Go files in the given ShipshapeContext.
api
Package api provides functionality for implementing Shipshape analyzers.
Package api provides functionality for implementing Shipshape analyzers.
proto/note_proto
Package note_proto_go_src is a generated protocol buffer package.
Package note_proto_go_src is a generated protocol buffer package.
proto/shipshape_config_proto
Package shipshape_config_proto_go_src is a generated protocol buffer package.
Package shipshape_config_proto_go_src is a generated protocol buffer package.
proto/shipshape_context_proto
Package shipshape_context_proto_go_src is a generated protocol buffer package.
Package shipshape_context_proto_go_src is a generated protocol buffer package.
proto/shipshape_reporter_proto
Package shipshape_reporter_proto_go_src is a generated protocol buffer package.
Package shipshape_reporter_proto_go_src is a generated protocol buffer package.
proto/shipshape_rpc_proto
Package shipshape_rpc_proto_go_src is a generated protocol buffer package.
Package shipshape_rpc_proto_go_src is a generated protocol buffer package.
proto/source_context_proto
Package source_context_proto_go_src is a generated protocol buffer package.
Package source_context_proto_go_src is a generated protocol buffer package.
proto/textrange_proto
Package textrange_proto_go_src is a generated protocol buffer package.
Package textrange_proto_go_src is a generated protocol buffer package.
test
Binary test_analyzer_client is a testing client that initiates a call to a shipshape analyzer.
Binary test_analyzer_client is a testing client that initiates a call to a shipshape analyzer.
util/delimited
Package delimited implements a reader and writer for simple streams of length-delimited byte records.
Package delimited implements a reader and writer for simple streams of length-delimited byte records.
util/docker
Package docker contains simple utilities for pulling a docker image, starting a container, and stoping a container.
Package docker contains simple utilities for pulling a docker image, starting a container, and stoping a container.
util/httpencoding
Package httpencoding provides functions to transparently encode/decode HTTP bodies
Package httpencoding provides functions to transparently encode/decode HTTP bodies
util/kindex
Binary kindex is a simple utility to print out the contents of a kindex file in a more human readable form.
Binary kindex is a simple utility to print out the contents of a kindex file in a more human readable form.
util/rpc/buffer
Package buffer implements a memory buffer with a limited capacity that can overflow into a file on disk.
Package buffer implements a memory buffer with a limited capacity that can overflow into a file on disk.
util/rpc/protocol
Package protocol defines the JSON K-RPC protocol types and constants.
Package protocol defines the JSON K-RPC protocol types and constants.
util/rpc/server
Package server provides an interface for defining KRPC services.
Package server provides an interface for defining KRPC services.
util/rpc/stream
Package stream implements a Reader and Writer for simple streams of either length-delimited byte records (using shipshape/util/delimited) or newline-delimited JSON values.
Package stream implements a Reader and Writer for simple streams of either length-delimited byte records (using shipshape/util/delimited) or newline-delimited JSON values.
util/rpc/tools
Binary unwrap_results reads in a JSON K-RPC response stream and writes each result.
Binary unwrap_results reads in a JSON K-RPC response stream and writes each result.
third_party
go-glog
Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup.
Package glog implements logging analogous to the Google-internal C++ INFO/ERROR/V setup.
go/src/github.com/golang/protobuf/proto
Package proto converts data structures to and from the wire format of protocol buffers.
Package proto converts data structures to and from the wire format of protocol buffers.
go/src/github.com/golang/protobuf/protoc-gen-go/descriptor
Package google_protobuf is a generated protocol buffer package.
Package google_protobuf is a generated protocol buffer package.
go/src/github.com/golang/protobuf/protoc-gen-go/generator
The code generator for the plugin for the Google protocol buffer compiler.
The code generator for the plugin for the Google protocol buffer compiler.
go/src/github.com/golang/protobuf/protoc-gen-go/internal/grpc
Package grpc outputs gRPC service descriptions in Go code.
Package grpc outputs gRPC service descriptions in Go code.
go/src/github.com/golang/protobuf/protoc-gen-go/plugin
Package google_protobuf_compiler is a generated protocol buffer package.
Package google_protobuf_compiler is a generated protocol buffer package.
go/src/gopkg.in/yaml.v2
Package yaml implements YAML support for the Go language.
Package yaml implements YAML support for the Go language.
kythe/go/platform/analysis
Package analysis defines interfaces used to locate and analyze compilation units and their inputs.
Package analysis defines interfaces used to locate and analyze compilation units and their inputs.
kythe/go/platform/delimited
Package delimited implements a reader and writer for simple streams of length-delimited byte records.
Package delimited implements a reader and writer for simple streams of length-delimited byte records.
kythe/go/platform/kindex
Package kindex implements an interface to compilation index files which are standalone CompilationUnits with all of their required inputs.
Package kindex implements an interface to compilation index files which are standalone CompilationUnits with all of their required inputs.
tools
cloudfs
Binary copy_cloud_repo copies down a cloud repo to a location on disk.
Binary copy_cloud_repo copies down a cloud repo to a location on disk.
go
Binary go_testmain_generator generates a main function for testing packages.
Binary go_testmain_generator generates a main function for testing packages.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL