avm-tools 0.142.8 → 0.143.0

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: c84f2e749cae1648862dc1b82d29c163827343bbd6b66f19bf5c7d0de245f102
4
- data.tar.gz: 8af6511fafa0eebc9485aaec675f4c626553d181ebad740c1686e96a1782c660
3
+ metadata.gz: fab6890dc62b07870be164bb09ea3403cb66ca9b05416dfddc3dd6d7197fe881
4
+ data.tar.gz: 1b8b944dfc31c738a4b4efbca860f2e3ab64c00843d08b03b2f2ef2a7b7369c3
5
5
  SHA512:
6
- metadata.gz: 4a3a5b531513a11fc1947d9c0c704c77f7f7723a581ce6b93f09f8852c353cfc4f875e151e6759a67a7ba628e8ebd7cfd6ee43e92b6680255c0fe475a1dfc823
7
- data.tar.gz: bdd574bd6ec63655e4b46439fa8116c9f05dbba9af06dbd86fc038a06895683ad870a253339c3a59b374d581699a329cbd378f745ad0725ce3c3a8c7ae17e929
6
+ metadata.gz: 87bdbe91033d37ef8950c88d4bb76a7d5e0b1e592a49f328abdc8ac0ef334e05504f7396b4e80c345b3ccb29f2f9bbfa2c0f774f51c47fe3b6829666129aecf7
7
+ data.tar.gz: c0096ed9eb6408d818f9676fd5bf77bde58d92d11daa8267cb0c4ea66c21c6605fc03652962628dc334614ae809f9061fc44d15cd1890d57aecb7237810be6e1
@@ -1,9 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'avm/tools/core_ext'
4
- require 'avm/git/auto_commit/rules/unique'
5
- require 'avm/git/file_auto_fixup'
4
+ require 'avm/git/scms/git'
6
5
  require 'avm/git/subrepo_checks'
6
+ require 'avm/scms/auto_commit/rules/unique'
7
+ require 'avm/scms/auto_commit/for_file'
7
8
  require 'eac_git/local'
8
9
 
9
10
  module Avm
@@ -31,8 +32,10 @@ module Avm
31
32
  infov 'Dirty files', local_repos.dirty_files.count
32
33
  local_repos.dirty_files.each do |file|
33
34
  infov ' * Ammending', file.path
34
- ::Avm::Git::FileAutoFixup.new(runner_context.call(:git), file.path,
35
- [::Avm::Git::AutoCommit::Rules::Unique.new]).run
35
+ ::Avm::Scms::AutoCommit::ForFile.new(
36
+ git_scm, file.path,
37
+ [::Avm::Scms::AutoCommit::Rules::Unique.new]
38
+ ).run
36
39
  end
37
40
  end
38
41
 
@@ -43,6 +46,11 @@ module Avm
43
46
  !c.result.error?
44
47
  end
45
48
 
49
+ # @return [Avm::Git::Scms::Git]
50
+ def git_scm_uncached
51
+ ::Avm::Git::Scms::Git.new(runner_context.call(:git).root_path)
52
+ end
53
+
46
54
  def new_check(fix_parent = false)
47
55
  r = ::Avm::Git::SubrepoChecks.new(local_repos).add_all_subrepos
48
56
  r.fix_parent = fix_parent
@@ -2,13 +2,13 @@
2
2
 
3
3
  require 'eac_cli/core_ext'
4
4
  require 'avm/file_formats/search_formatter'
5
- require 'avm/git/file_auto_fixup'
6
- require 'avm/git/auto_commit/rules'
5
+ require 'avm/scms/auto_commit/for_file'
6
+ require 'avm/scms/auto_commit/rules'
7
7
 
8
8
  module Avm
9
9
  module Tools
10
10
  class Runner
11
- class Git
11
+ class Source < ::Avm::Sources::Runner
12
12
  class AutoCommit
13
13
  runner_with :help do
14
14
  desc 'Auto fixup files.'
@@ -19,13 +19,18 @@ module Avm
19
19
  end
20
20
 
21
21
  def run
22
- runner_context.call(:git).command('reset', 'HEAD').system!
23
22
  format_files
24
23
  files.each do |file|
25
- ::Avm::Git::FileAutoFixup.new(runner_context.call(:git), file, rules).run
24
+ ::Avm::Scms::AutoCommit::ForFile.new(runner_context.call(:source).scm, file, rules)
25
+ .run
26
26
  end
27
27
  end
28
28
 
29
+ def help_extra_text
30
+ "Rules\n" + ::Avm::Scms::AutoCommit::Rules.all
31
+ .map { |r| ' ' + r.keys.join(', ') + "\n" }.join
32
+ end
33
+
29
34
  private
30
35
 
31
36
  def files_uncached
@@ -48,14 +53,12 @@ module Avm
48
53
  def dirty_files
49
54
  return [] unless parsed.dirty?
50
55
 
51
- runner_context.call(:git).dirty_files.map do |file|
52
- file.path.to_pathname.expand_path(runner_context.call(:git).root_path)
53
- end
56
+ runner_context.call(:source).scm.changed_files.map(&:absolute_path)
54
57
  end
55
58
 
56
59
  def rules
57
60
  parsed.rule.map do |rule_string|
58
- ::Avm::Git::AutoCommit::Rules.parse(rule_string)
61
+ ::Avm::Scms::AutoCommit::Rules.parse(rule_string)
59
62
  end
60
63
  end
61
64
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Tools
5
- VERSION = '0.142.8'
5
+ VERSION = '0.143.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avm-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.142.8
4
+ version: 0.143.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Esquilo Azul Company
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-16 00:00:00.000000000 Z
11
+ date: 2023-01-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aranha-parsers
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.57'
39
+ version: '0.59'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.57'
46
+ version: '0.59'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: avm-eac_ruby_base1
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -98,20 +98,14 @@ dependencies:
98
98
  requirements:
99
99
  - - "~>"
100
100
  - !ruby/object:Gem::Version
101
- version: '0.10'
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- version: 0.10.1
101
+ version: '0.11'
105
102
  type: :runtime
106
103
  prerelease: false
107
104
  version_requirements: !ruby/object:Gem::Requirement
108
105
  requirements:
109
106
  - - "~>"
110
107
  - !ruby/object:Gem::Version
111
- version: '0.10'
112
- - - ">="
113
- - !ruby/object:Gem::Version
114
- version: 0.10.1
108
+ version: '0.11'
115
109
  - !ruby/object:Gem::Dependency
116
110
  name: clipboard
117
111
  requirement: !ruby/object:Gem::Requirement
@@ -271,7 +265,6 @@ files:
271
265
  - lib/avm/tools/runner/files/format.rb
272
266
  - lib/avm/tools/runner/files/rotate.rb
273
267
  - lib/avm/tools/runner/git.rb
274
- - lib/avm/tools/runner/git/auto_commit.rb
275
268
  - lib/avm/tools/runner/git/commit.rb
276
269
  - lib/avm/tools/runner/git/deploy.rb
277
270
  - lib/avm/tools/runner/git/dirty_files.rb
@@ -293,6 +286,7 @@ files:
293
286
  - lib/avm/tools/runner/self/docker.rb
294
287
  - lib/avm/tools/runner/self/registry.rb
295
288
  - lib/avm/tools/runner/source.rb
289
+ - lib/avm/tools/runner/source/auto_commit.rb
296
290
  - lib/avm/tools/runner/source/info.rb
297
291
  - lib/avm/tools/runner/source/issue.rb
298
292
  - lib/avm/tools/runner/source/issue/complete.rb