From 3e86a0b496eee935cf67048d7f90e277de0a8c79 Mon Sep 17 00:00:00 2001 From: Lee Machin Date: Tue, 17 Jan 2017 10:55:23 +0100 Subject: [PATCH] Add rubocop linter for Ruby (#21934) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use gemdir and pname as suggested by @zimbatm Fix silly typo --- lib/maintainers.nix | 1 + pkgs/development/tools/rubocop/Gemfile | 3 + pkgs/development/tools/rubocop/Gemfile.lock | 27 ++++++++ pkgs/development/tools/rubocop/default.nix | 17 +++++ pkgs/development/tools/rubocop/gemset.nix | 69 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 6 files changed, 119 insertions(+) create mode 100644 pkgs/development/tools/rubocop/Gemfile create mode 100644 pkgs/development/tools/rubocop/Gemfile.lock create mode 100644 pkgs/development/tools/rubocop/default.nix create mode 100644 pkgs/development/tools/rubocop/gemset.nix diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 9ba52bdefb4..b7ca05af16a 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -248,6 +248,7 @@ ldesgoui = "Lucas Desgouilles "; league = "Christopher League "; lebastr = "Alexander Lebedev "; + leemachin = "Lee Machin "; leenaars = "Michiel Leenaars "; leonardoce = "Leonardo Cecchi "; lethalman = "Luca Bruno "; diff --git a/pkgs/development/tools/rubocop/Gemfile b/pkgs/development/tools/rubocop/Gemfile new file mode 100644 index 00000000000..f6ab81c8112 --- /dev/null +++ b/pkgs/development/tools/rubocop/Gemfile @@ -0,0 +1,3 @@ +source 'https://rubygems.org' +gem 'rake' +gem 'rubocop' diff --git a/pkgs/development/tools/rubocop/Gemfile.lock b/pkgs/development/tools/rubocop/Gemfile.lock new file mode 100644 index 00000000000..abc782465cc --- /dev/null +++ b/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 diff --git a/pkgs/development/tools/rubocop/default.nix b/pkgs/development/tools/rubocop/default.nix new file mode 100644 index 00000000000..850fb5ad7f5 --- /dev/null +++ b/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; + }; +} diff --git a/pkgs/development/tools/rubocop/gemset.nix b/pkgs/development/tools/rubocop/gemset.nix new file mode 100644 index 00000000000..908b5b76dd3 --- /dev/null +++ b/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"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fb5c9f055e2..1c148094f31 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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 { };