Code Monkey home page Code Monkey logo

gem-lint's Introduction

GemLint

Sanity check your rubygems for common issues. Missing readmes, bundled pkg directories, encoding issues in the gemspec, etc.

Each test is classified as an error or warning. Errors are issues that (by my reading) violate the documented gem specs. Warnings are either best practices recommended by members of the community or arbitrary things that annoy me personally.

Usage

gem install gem-lint
gem lint somefile-0.0.1.gem
gem lint somefile-0.0.1.gem --detailed

API

To check a gem programmatically:

require "gem_lint"

runner = GemLint::Runner.new("widgets-1.0.gem")
puts runner.name
puts runner.version
puts runner.email
puts runner.tags

Status

This a spike. It has few tests and is a proof of concept. Most of it was written at a Railscamp and therefore is probably of suspect quality.

Compatability

Rubygems 1.3.2 or greater is required, otherwise it’s pure ruby should run on most ruby VMs.

Developing

To add new checks, create a new strategy in lib/gem_lint/strategies with a matching spec in spec/strategies.

View other strategies for an idea of the required contract. There are existing specs to ensure all strategies confirm to the contract, so keep the full spec suit (using “rake”) green.

Full source is on github at github.com/yob/gem-lint

Ideas for new checks

  • improved handling of compiled extensions

  • files entry in spec not matching actual files in data

  • contains compiled .o files for wrong arch (check glib2 0.90.6 for example)

Further Reading

gem-lint's People

Contributors

yob avatar

Stargazers

Angus H. avatar Simon Hürlimann avatar  avatar

Watchers

James Cloos avatar

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.