rake_leiningen 0.4.0 → 0.5.0.pre.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 387376ea318a6e5c4fcd1134d92054aa8af61ffcdc76d6b50a7c4e2f2850a914
4
- data.tar.gz: ffe1bbed16a80abad3052c42a564e5f4fc10520270e0f6cd1a50716459f112ee
3
+ metadata.gz: fec72dfd178142a7a51f577e110d1c7902c79145d46041bdf09b5a2a122083ac
4
+ data.tar.gz: 925392a7345b17ff4622be91b36dbdae33e20f91d6e7e3e162949460883c1b7c
5
5
  SHA512:
6
- metadata.gz: 8114f9efd9ff2fa3371b46600bd9fa8ce47a6f390c3b0861f65e8ee53c592a7f58e319902bb6ff84f38f15ba9826ec4e4655b6cbe7e9012e4b9d2dd525eabcf7
7
- data.tar.gz: c2d297035d769598cc38d010dce6bca9d6e46c39c056156937101331a9390d8c78039976092636d354282e027b7d7b64f246ca41449cf0c15eae5b0948e68b52
6
+ metadata.gz: 82ca69f481ec630d657e2d65a57bb053ea81c817c0a7923e0cfa598ce63f2dde32284f3d7c4b8454a8db93b1fd50f5865b48321c9cd1f0a3a0006078aaace27f
7
+ data.tar.gz: aa0d112d2f8d15113d9a85223fcdf2908051b095beabe8171916ba7edad9ab653cc761f141807b5bad01f7f8a06fb00fc1e37a5b39488288ae3e7dbad4ab9631
data/Gemfile.lock CHANGED
@@ -1,19 +1,21 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rake_leiningen (0.4.0)
4
+ rake_leiningen (0.5.0.pre.1)
5
5
  rake_dependencies (~> 1.10)
6
- rake_factory (~> 0.17)
6
+ rake_factory (>= 0.17)
7
+ ruby_leiningen (~> 0.5)
7
8
  semantic (~> 1.6.1)
8
9
 
9
10
  GEM
10
11
  remote: https://rubygems.org/
11
12
  specs:
12
- activesupport (5.2.4.1)
13
+ activesupport (6.0.2.1)
13
14
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
15
  i18n (>= 0.7, < 2)
15
16
  minitest (~> 5.1)
16
17
  tzinfo (~> 1.1)
18
+ zeitwerk (~> 2.2)
17
19
  concurrent-ruby (1.1.5)
18
20
  diff-lcs (1.3)
19
21
  docile (1.3.2)
@@ -24,16 +26,20 @@ GEM
24
26
  i18n (1.8.2)
25
27
  concurrent-ruby (~> 1.0)
26
28
  json (2.3.0)
29
+ lino (1.1.0)
30
+ hamster (~> 3.0)
31
+ open4 (~> 1.3)
27
32
  minitar (0.9)
28
33
  minitest (5.14.0)
34
+ open4 (1.3.4)
29
35
  rake (13.0.1)
30
36
  rake_dependencies (1.10.0)
31
37
  hamster (~> 3.0)
32
38
  minitar (~> 0.9)
33
39
  rake_factory (>= 0.11)
34
40
  rubyzip (~> 2.0)
35
- rake_factory (0.17.0)
36
- activesupport (~> 5.2)
41
+ rake_factory (0.19.0)
42
+ activesupport (>= 5.2)
37
43
  rake (~> 13.0)
38
44
  rspec (3.9.0)
39
45
  rspec-core (~> 3.9.0)
@@ -48,7 +54,10 @@ GEM
48
54
  diff-lcs (>= 1.2.0, < 2.0)
49
55
  rspec-support (~> 3.9.0)
50
56
  rspec-support (3.9.2)
51
- rubyzip (2.1.0)
57
+ ruby_leiningen (0.5.0)
58
+ activesupport (~> 6.0, >= 6.0.2)
59
+ lino (~> 1.1)
60
+ rubyzip (2.2.0)
52
61
  semantic (1.6.1)
53
62
  simplecov (0.17.1)
54
63
  docile (~> 1.1)
@@ -58,12 +67,13 @@ GEM
58
67
  thread_safe (0.3.6)
59
68
  tzinfo (1.2.6)
60
69
  thread_safe (~> 0.1)
70
+ zeitwerk (2.2.2)
61
71
 
62
72
  PLATFORMS
63
73
  ruby
64
74
 
65
75
  DEPENDENCIES
66
- activesupport (~> 5.2)
76
+ activesupport (>= 5.2)
67
77
  bundler (~> 2.1)
68
78
  fakefs (~> 1.0)
69
79
  gem-release (~> 2.0)
@@ -0,0 +1,13 @@
1
+ module RakeLeiningen
2
+ module Mixins
3
+ module Directoried
4
+ def in_directory(directory, &block)
5
+ if directory
6
+ Dir.chdir(directory, &block)
7
+ else
8
+ block.call
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,41 @@
1
+ require 'rake_factory'
2
+
3
+ require_relative '../tasks/lint'
4
+ require_relative '../tasks/optimise'
5
+ require_relative '../tasks/idiomise'
6
+ require_relative '../tasks/format'
7
+ require_relative '../tasks/pedantise'
8
+ require_relative '../tasks/check'
9
+
10
+ module RakeLeiningen
11
+ module TaskSets
12
+ class Checks < RakeFactory::TaskSet
13
+ parameter :argument_names, default: []
14
+
15
+ parameter :profile
16
+ parameter :directory, default: '.'
17
+
18
+ parameter :ensure_task_name, default: 'leiningen:ensure'
19
+
20
+ parameter :lint_task_name, :default => :lint
21
+ parameter :optimise_task_name, :default => :optimise
22
+ parameter :idiomise_task_name, :default => :idiomise
23
+ parameter :format_task_name, :default => :format
24
+ parameter :pedantise_task_name, :default => :pedantise
25
+ parameter :check_task_name, :default => :check
26
+
27
+ task Tasks::Lint,
28
+ name: ->(ts) { ts.lint_task_name }
29
+ task Tasks::Optimise,
30
+ name: ->(ts) { ts.optimise_task_name }
31
+ task Tasks::Idiomise,
32
+ name: ->(ts) { ts.idiomise_task_name }
33
+ task Tasks::Format,
34
+ name: ->(ts) { ts.format_task_name }
35
+ task Tasks::Pedantise,
36
+ name: ->(ts) { ts.pedantise_task_name }
37
+ task Tasks::Check,
38
+ name: ->(ts) { ts.check_task_name }
39
+ end
40
+ end
41
+ end
@@ -0,0 +1 @@
1
+ require_relative 'task_sets/checks'
@@ -0,0 +1,31 @@
1
+ require 'rake_factory'
2
+ require 'ruby_leiningen'
3
+ require 'ruby_leiningen/plugins'
4
+
5
+ require_relative '../mixins/directoried'
6
+
7
+ module RakeLeiningen
8
+ module Tasks
9
+ class Check < RakeFactory::Task
10
+ include Mixins::Directoried
11
+
12
+ default_name :check
13
+ default_description "Perform all checks against clojure files."
14
+ default_prerequisites ->(t) {
15
+ [
16
+ t.lint_task_name,
17
+ t.optimise_task_name,
18
+ t.idiomise_task_name,
19
+ t.format_task_name,
20
+ t.pedantise_task_name
21
+ ]
22
+ }
23
+
24
+ parameter :lint_task_name, default: :lint
25
+ parameter :optimise_task_name, default: :optimise
26
+ parameter :idiomise_task_name, default: :idiomise
27
+ parameter :format_task_name, default: :format
28
+ parameter :pedantise_task_name, default: :pedantise
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,38 @@
1
+ require 'rake_factory'
2
+ require 'ruby_leiningen'
3
+ require 'ruby_leiningen/plugins'
4
+
5
+ require_relative '../mixins/directoried'
6
+
7
+ module RakeLeiningen
8
+ module Tasks
9
+ class Format < RakeFactory::Task
10
+ include Mixins::Directoried
11
+
12
+ default_name :format
13
+ default_description "Format all clojure files."
14
+ default_prerequisites ->(t) {
15
+ t.ensure_task_name ? [t.ensure_task_name] : []
16
+ }
17
+
18
+ parameter :mode
19
+ parameter :paths
20
+ parameter :profile
21
+
22
+ parameter :directory, default: '.'
23
+
24
+ parameter :ensure_task_name, default: 'leiningen:ensure'
25
+
26
+ action do |t|
27
+ puts "Formatting all clojure files..."
28
+
29
+ in_directory(t.directory) do
30
+ RubyLeiningen.cljfmt(
31
+ mode: t.mode,
32
+ paths: t.paths,
33
+ profile: t.profile)
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,42 @@
1
+ require 'rake_factory'
2
+ require 'ruby_leiningen'
3
+ require 'ruby_leiningen/plugins'
4
+
5
+ require_relative '../mixins/directoried'
6
+
7
+ module RakeLeiningen
8
+ module Tasks
9
+ class Idiomise < RakeFactory::Task
10
+ include Mixins::Directoried
11
+
12
+ default_name :idiomise
13
+ default_description "Transform all clojure files to be more idiomatic."
14
+ default_prerequisites ->(t) {
15
+ t.ensure_task_name ? [t.ensure_task_name] : []
16
+ }
17
+
18
+ parameter :replace
19
+ parameter :interactive
20
+ parameter :reporter
21
+ parameter :paths
22
+ parameter :profile
23
+
24
+ parameter :directory, default: '.'
25
+
26
+ parameter :ensure_task_name, default: 'leiningen:ensure'
27
+
28
+ action do |t|
29
+ puts "Making all clojure files more idiomatic..."
30
+
31
+ in_directory(t.directory) do
32
+ RubyLeiningen.kibit(
33
+ replace: t.replace,
34
+ interactive: t.interactive,
35
+ reporter: t.reporter,
36
+ paths: t.paths,
37
+ profile: t.profile)
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,36 @@
1
+ require 'rake_factory'
2
+ require 'ruby_leiningen'
3
+ require 'ruby_leiningen/plugins'
4
+
5
+ require_relative '../mixins/directoried'
6
+
7
+ module RakeLeiningen
8
+ module Tasks
9
+ class Lint < RakeFactory::Task
10
+ include Mixins::Directoried
11
+
12
+ default_name :lint
13
+ default_description "Lint all clojure files."
14
+ default_prerequisites ->(t) {
15
+ t.ensure_task_name ? [t.ensure_task_name] : []
16
+ }
17
+
18
+ parameter :config
19
+ parameter :profile
20
+
21
+ parameter :directory, default: '.'
22
+
23
+ parameter :ensure_task_name, default: 'leiningen:ensure'
24
+
25
+ action do |t|
26
+ puts "Linting all clojure files..."
27
+
28
+ in_directory(t.directory) do
29
+ RubyLeiningen.eastwood(
30
+ config: t.config,
31
+ profile: t.profile)
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,34 @@
1
+ require 'rake_factory'
2
+ require 'ruby_leiningen'
3
+ require 'ruby_leiningen/plugins'
4
+
5
+ require_relative '../mixins/directoried'
6
+
7
+ module RakeLeiningen
8
+ module Tasks
9
+ class Optimise < RakeFactory::Task
10
+ include Mixins::Directoried
11
+
12
+ default_name :optimise
13
+ default_description "Warn on reflection for all clojure files."
14
+ default_prerequisites ->(t) {
15
+ t.ensure_task_name ? [t.ensure_task_name] : []
16
+ }
17
+
18
+ parameter :profile
19
+
20
+ parameter :directory, default: '.'
21
+
22
+ parameter :ensure_task_name, default: 'leiningen:ensure'
23
+
24
+ action do |t|
25
+ puts "Checking for uses of reflection in all clojure files..."
26
+
27
+ in_directory(t.directory) do
28
+ RubyLeiningen.check(
29
+ profile: t.profile)
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,54 @@
1
+ require 'rake_factory'
2
+ require 'ruby_leiningen'
3
+ require 'ruby_leiningen/plugins'
4
+
5
+ require_relative '../mixins/directoried'
6
+
7
+ module RakeLeiningen
8
+ module Tasks
9
+ class Pedantise < RakeFactory::Task
10
+ include Mixins::Directoried
11
+
12
+ default_name :pedantise
13
+ default_description "Hunt for 'bad' code in all clojure files."
14
+ default_prerequisites ->(t) {
15
+ t.ensure_task_name ? [t.ensure_task_name] : []
16
+ }
17
+
18
+ parameter :show_help
19
+ parameter :verbose
20
+ parameter :maximum_line_length
21
+ parameter :long_lines
22
+ parameter :trailing_whitespace
23
+ parameter :trailing_blank_lines
24
+ parameter :var_redefs
25
+ parameter :docstrings
26
+ parameter :name_collisions
27
+ parameter :exclude_profiles
28
+ parameter :profile
29
+
30
+ parameter :directory, default: '.'
31
+
32
+ parameter :ensure_task_name, default: 'leiningen:ensure'
33
+
34
+ action do |t|
35
+ puts "Looking for 'bad' code in all clojure files..."
36
+
37
+ in_directory(t.directory) do
38
+ RubyLeiningen.bikeshed(
39
+ show_help: t.show_help,
40
+ verbose: t.verbose,
41
+ maximum_line_length: t.maximum_line_length,
42
+ long_lines: t.long_lines,
43
+ trailing_whitespace: t.trailing_whitespace,
44
+ trailing_blank_lines: t.trailing_blank_lines,
45
+ var_redefs: t.var_redefs,
46
+ docstrings: t.docstrings,
47
+ name_collisions: t.name_collisions,
48
+ exclude_profiles: t.exclude_profiles,
49
+ profile: t.profile)
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,6 @@
1
+ require_relative 'tasks/lint'
2
+ require_relative 'tasks/optimise'
3
+ require_relative 'tasks/idiomise'
4
+ require_relative 'tasks/format'
5
+ require_relative 'tasks/pedantise'
6
+ require_relative 'tasks/check'
@@ -1,3 +1,3 @@
1
1
  module RakeLeiningen
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0.pre.1'
3
3
  end
@@ -1,12 +1,18 @@
1
1
  require 'rake_dependencies'
2
2
  require 'rake_leiningen/version'
3
+ require 'rake_leiningen/tasks'
4
+ require 'rake_leiningen/task_sets'
3
5
 
4
6
  module RakeLeiningen
7
+ def self.define_check_tasks(opts = {}, &block)
8
+ RakeLeiningen::TaskSets::Checks.define(opts, &block)
9
+ end
10
+
5
11
  def self.define_installation_tasks(opts = {})
6
12
  namespace = opts[:namespace] || :leiningen
7
13
  dependency = 'lein'
8
14
  version = opts[:version] || '2.9.1'
9
- path = opts[:path] || File.join('vendor', 'leiningen')
15
+ path = opts[:path] || File.join(Dir.pwd, 'vendor', 'leiningen')
10
16
  type = :uncompressed
11
17
  uri_template = "https://raw.githubusercontent.com/technomancy/" +
12
18
  "leiningen/<%= @version %>/bin/lein"
@@ -30,6 +36,10 @@ module RakeLeiningen
30
36
  return true
31
37
  end
32
38
 
39
+ RubyLeiningen.configure do |c|
40
+ c.binary = File.join(path, 'bin', 'lein')
41
+ end
42
+
33
43
  RakeDependencies::TaskSets::All.define(
34
44
  namespace: namespace,
35
45
  dependency: dependency,
@@ -25,14 +25,15 @@ Gem::Specification.new do |spec|
25
25
  spec.required_ruby_version = '>= 2.6.0'
26
26
 
27
27
  spec.add_dependency 'rake_dependencies', '~> 1.10'
28
- spec.add_dependency 'rake_factory', '~> 0.17'
28
+ spec.add_dependency 'rake_factory', '>= 0.17'
29
+ spec.add_dependency 'ruby_leiningen', '~> 0.5'
29
30
  spec.add_dependency 'semantic', '~> 1.6.1'
30
31
 
31
32
  spec.add_development_dependency 'bundler', '~> 2.1'
32
33
  spec.add_development_dependency 'rake', '~> 13.0'
33
34
  spec.add_development_dependency 'rspec', '~> 3.8'
34
35
  spec.add_development_dependency 'gem-release', '~> 2.0'
35
- spec.add_development_dependency 'activesupport', '~> 5.2'
36
+ spec.add_development_dependency 'activesupport', '>= 5.2'
36
37
  spec.add_development_dependency 'fakefs', '~> 1.0'
37
38
  spec.add_development_dependency 'simplecov', '~> 0.16'
38
39
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rake_leiningen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toby Clemson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-27 00:00:00.000000000 Z
11
+ date: 2020-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake_dependencies
@@ -28,16 +28,30 @@ dependencies:
28
28
  name: rake_factory
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0.17'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.17'
41
+ - !ruby/object:Gem::Dependency
42
+ name: ruby_leiningen
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.5'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.5'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: semantic
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -112,14 +126,14 @@ dependencies:
112
126
  name: activesupport
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
- - - "~>"
129
+ - - ">="
116
130
  - !ruby/object:Gem::Version
117
131
  version: '5.2'
118
132
  type: :development
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
- - - "~>"
136
+ - - ">="
123
137
  - !ruby/object:Gem::Version
124
138
  version: '5.2'
125
139
  - !ruby/object:Gem::Dependency
@@ -185,6 +199,16 @@ files:
185
199
  - config/secrets/rubygems/credentials
186
200
  - go
187
201
  - lib/rake_leiningen.rb
202
+ - lib/rake_leiningen/mixins/directoried.rb
203
+ - lib/rake_leiningen/task_sets.rb
204
+ - lib/rake_leiningen/task_sets/checks.rb
205
+ - lib/rake_leiningen/tasks.rb
206
+ - lib/rake_leiningen/tasks/check.rb
207
+ - lib/rake_leiningen/tasks/format.rb
208
+ - lib/rake_leiningen/tasks/idiomise.rb
209
+ - lib/rake_leiningen/tasks/lint.rb
210
+ - lib/rake_leiningen/tasks/optimise.rb
211
+ - lib/rake_leiningen/tasks/pedantise.rb
188
212
  - lib/rake_leiningen/version.rb
189
213
  - rake_leiningen.gemspec
190
214
  - scripts/ci/common/configure-git.sh
@@ -209,9 +233,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
209
233
  version: 2.6.0
210
234
  required_rubygems_version: !ruby/object:Gem::Requirement
211
235
  requirements:
212
- - - ">="
236
+ - - ">"
213
237
  - !ruby/object:Gem::Version
214
- version: '0'
238
+ version: 1.3.1
215
239
  requirements: []
216
240
  rubygems_version: 3.0.1
217
241
  signing_key: