Skip to content

Commit

Permalink
Add rubocop linter for Ruby (#21934)
Browse files Browse the repository at this point in the history
Use gemdir and pname as suggested by @zimbatm

Fix silly typo
  • Loading branch information
Lee Machin authored and zimbatm committed Jan 17, 2017
1 parent cc0981b commit 3e86a0b
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/maintainers.nix
Expand Up @@ -248,6 +248,7 @@
ldesgoui = "Lucas Desgouilles <ldesgoui@gmail.com>";
league = "Christopher League <league@contrapunctus.net>";
lebastr = "Alexander Lebedev <lebastr@gmail.com>";
leemachin = "Lee Machin <me@mrl.ee>";
leenaars = "Michiel Leenaars <ml.software@leenaa.rs>";
leonardoce = "Leonardo Cecchi <leonardo.cecchi@gmail.com>";
lethalman = "Luca Bruno <lucabru@src.gnome.org>";
Expand Down
3 changes: 3 additions & 0 deletions pkgs/development/tools/rubocop/Gemfile
@@ -0,0 +1,3 @@
source 'https://rubygems.org'
gem 'rake'
gem 'rubocop'
27 changes: 27 additions & 0 deletions pkgs/development/tools/rubocop/Gemfile.lock
@@ -0,0 +1,27 @@
GEM
remote: https://rubygems.org/
specs:
ast (2.3.0)
parser (2.3.3.1)
ast (~> 2.2)
powerpack (0.1.1)
rainbow (2.2.1)
rake (12.0.0)
rubocop (0.47.0)
parser (>= 2.3.3.1, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.8.1)
unicode-display_width (1.1.3)

PLATFORMS
ruby

DEPENDENCIES
rake
rubocop

BUNDLED WITH
1.13.7
17 changes: 17 additions & 0 deletions pkgs/development/tools/rubocop/default.nix
@@ -0,0 +1,17 @@
{ stdenv, lib, bundlerEnv, ruby, makeWrapper }:

bundlerEnv rec {
pname = "rubocop";

inherit ruby;

gemdir = ./.;

meta = with lib; {
description = "Automatic Ruby code style checking tool";
homepage = http://rubocop.readthedocs.io/en/latest/;
license = licenses.mit;
maintainers = with maintainers; [ leemachin ];
platforms = platforms.unix;
};
}
69 changes: 69 additions & 0 deletions pkgs/development/tools/rubocop/gemset.nix
@@ -0,0 +1,69 @@
{
ast = {
source = {
remotes = ["https://rubygems.org"];
sha256 = "0pp82blr5fakdk27d1d21xq9zchzb6vmyb1zcsl520s3ygvprn8m";
type = "gem";
};
version = "2.3.0";
};
parser = {
dependencies = ["ast"];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1nply96nqrkgx8d3jay31sfy5p4q74dg8ymln0mdazxx5cz2n8bq";
type = "gem";
};
version = "2.3.3.1";
};
powerpack = {
source = {
remotes = ["https://rubygems.org"];
sha256 = "1fnn3fli5wkzyjl4ryh0k90316shqjfnhydmc7f8lqpi0q21va43";
type = "gem";
};
version = "0.1.1";
};
rainbow = {
dependencies = ["rake"];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0frz90gyi5k26jx3ham1x661hpkxf82rkxb85nakcz70dna7i8ri";
type = "gem";
};
version = "2.2.1";
};
rake = {
source = {
remotes = ["https://rubygems.org"];
sha256 = "01j8fc9bqjnrsxbppncai05h43315vmz9fwg28qdsgcjw9ck1d7n";
type = "gem";
};
version = "12.0.0";
};
rubocop = {
dependencies = ["parser" "powerpack" "rainbow" "ruby-progressbar" "unicode-display_width"];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1lsv3zbjl14nqyqqvcwciz15nq76l7vg97nydrdsrxs2bc5jrlsm";
type = "gem";
};
version = "0.47.0";
};
ruby-progressbar = {
source = {
remotes = ["https://rubygems.org"];
sha256 = "1qzc7s7r21bd7ah06kskajc2bjzkr9y0v5q48y0xwh2l55axgplm";
type = "gem";
};
version = "1.8.1";
};
unicode-display_width = {
source = {
remotes = ["https://rubygems.org"];
sha256 = "1r28mxyi0zwby24wyn1szj5hcnv67066wkv14wyzsc94bf04fqhx";
type = "gem";
};
version = "1.1.3";
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/all-packages.nix
Expand Up @@ -3664,6 +3664,8 @@ in
rtorrent = callPackage ../tools/networking/p2p/rtorrent { };

rubber = callPackage ../tools/typesetting/rubber { };

rubocop = callPackage ../development/tools/rubocop { };

runningx = callPackage ../tools/X11/runningx { };

Expand Down

0 comments on commit 3e86a0b

Please sign in to comment.