yast-rake 0.2.25 → 0.2.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/tasks/rubocop.rake +45 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bdded9659f2fd5a53bde7e031db894092098cd1d975e373105af573c1bd21525
|
4
|
+
data.tar.gz: d888aeb8f92dfb29418b29e952c29d49b309710814d57989c155d6c1a44d4717
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 991cb3c588b988ccf313e907d04e6e960f862e058a55a2010111f2ae1941d57e40b2d25a86ecb761cf3b315eda6ac64df42733faf31b3115ea11b8ca06602b06
|
7
|
+
data.tar.gz: 1c2a32a544d67b501b420401e8b63098cf43cccdc4ecbf71fed547aa40281b0e046952d29c6bd0c950969f400e55472be604234db09a23812a34e31ed1d005cb
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.26
|
@@ -0,0 +1,45 @@
|
|
1
|
+
#--
|
2
|
+
# Yast rake
|
3
|
+
#
|
4
|
+
# Copyright (C) 2018 SUSE LLC
|
5
|
+
# This library is free software; you can redistribute it and/or modify
|
6
|
+
# it only under the terms of version 2.1 of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation.
|
8
|
+
#
|
9
|
+
# This library is distributed in the hope that it will be useful, but WITHOUT
|
10
|
+
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
11
|
+
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
12
|
+
# details.
|
13
|
+
#
|
14
|
+
#++
|
15
|
+
|
16
|
+
# run Rubocop in parallel
|
17
|
+
# @param params [String] optional Rubocop parameters
|
18
|
+
def run_rubocop(params = "")
|
19
|
+
# how it works:
|
20
|
+
# 1) get the list of inspected files by Rubocop
|
21
|
+
# 2) shuffle it randomly (better would be evenly distribute them according to
|
22
|
+
# the analysis complexity but that is hard to evaluate and even simply
|
23
|
+
# distributing by file size turned out to be ineffective and slower than
|
24
|
+
# a simple random shuffling)
|
25
|
+
# 3) pass that as input for xargs
|
26
|
+
# a) use -P with number of processors to run the commands in parallel
|
27
|
+
# b) use -n to set the maximum number of files per process, this number
|
28
|
+
# is computed to equally distribute the files across the workers
|
29
|
+
sh "rubocop -L | sort -R | xargs -P`nproc` -n$(expr `rubocop -L | wc -l` / " \
|
30
|
+
"`nproc` + 1) rubocop #{params}"
|
31
|
+
end
|
32
|
+
|
33
|
+
namespace :check do
|
34
|
+
desc "Run Rubocop in parallel"
|
35
|
+
task :rubocop, [:options] do |_task, args|
|
36
|
+
args.with_defaults = { options: "" }
|
37
|
+
run_rubocop(args[:options])
|
38
|
+
end
|
39
|
+
|
40
|
+
desc "Run Rubocop in parallel in the auto correct mode"
|
41
|
+
task :"rubocop:auto_correct", [:options] do |_task, args|
|
42
|
+
args.with_defaults = { options: "" }
|
43
|
+
run_rubocop("-a #{args[:options]}")
|
44
|
+
end
|
45
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yast-rake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.26
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josef Reidinger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -52,6 +52,7 @@ files:
|
|
52
52
|
- data/targets.yml
|
53
53
|
- lib/tasks/install.rake
|
54
54
|
- lib/tasks/pot.rake
|
55
|
+
- lib/tasks/rubocop.rake
|
55
56
|
- lib/tasks/run.rake
|
56
57
|
- lib/tasks/spell.yml
|
57
58
|
- lib/tasks/spellcheck.rake
|