pronto-rails_migrations_annotated 0.0.3 → 0.0.5

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: 88430fc4dc1457f81ee58ddbb791363370cb6e85fcd6ffe17b504717a637d5de
4
- data.tar.gz: e7f1c20a1f124f27506cb1494d756d1ab314cd9217ce075e68e7a42842380030
3
+ metadata.gz: e35554920a786374696461d01c168c4ca1402367fac9a70a5b7773d0319fdaea
4
+ data.tar.gz: 58b72c0c38bd9c18c10d336ebb71da9571f6cb04e728ef4c1eabeddb7a321c83
5
5
  SHA512:
6
- metadata.gz: 0f56e324b56c92ef3e2957bd39a6dba969e6fa4748bf8acadc1e077288cf0abb882b6e30b9c7c1f9a6d4d0a73b2be713a344e66c8c2d5aee667e7e6dd379f21d
7
- data.tar.gz: a9f3ebffd0dd50bc1549d669069cc27a0f3cd67dc0064d428c03f1adffcd0d58df885485e4b9458dbb0c95a8a244e4dc479fbffbb7b2ea169742a73e7b7db5ad
6
+ metadata.gz: f2b895e654cf9b9b170d344093615014760d9fe377fedf8ccadf65c13817a5ce7fb7d9ea0a4d2e2ff9343e3ba366b53555614a6f36405ec1ff1f16ed652142d6
7
+ data.tar.gz: 86b29d8e6fc2783fdb70311d0613ce673db46af9f0934cbcb7ec321665f0651ccef4b673f0d059c043a2574ebe5d349be379b2d417aa6f04b8826d1f8bd1ef77
data/Gemfile.lock CHANGED
@@ -1,49 +1,33 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pronto-rails_migrations_annotated (0.0.3)
4
+ pronto-rails_migrations_annotated (0.0.5)
5
5
  pronto (~> 0.11)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- addressable (2.8.0)
11
- public_suffix (>= 2.0.2, < 5.0)
10
+ addressable (2.8.1)
11
+ public_suffix (>= 2.0.2, < 6.0)
12
12
  ast (2.4.2)
13
13
  diff-lcs (1.4.4)
14
- faraday (1.8.0)
15
- faraday-em_http (~> 1.0)
16
- faraday-em_synchrony (~> 1.0)
17
- faraday-excon (~> 1.1)
18
- faraday-httpclient (~> 1.0.1)
19
- faraday-net_http (~> 1.0)
20
- faraday-net_http_persistent (~> 1.1)
21
- faraday-patron (~> 1.0)
22
- faraday-rack (~> 1.0)
23
- multipart-post (>= 1.2, < 3)
14
+ faraday (2.5.2)
15
+ faraday-net_http (>= 2.0, < 3.1)
24
16
  ruby2_keywords (>= 0.0.4)
25
- faraday-em_http (1.0.0)
26
- faraday-em_synchrony (1.0.0)
27
- faraday-excon (1.1.0)
28
- faraday-httpclient (1.0.1)
29
- faraday-net_http (1.0.1)
30
- faraday-net_http_persistent (1.2.0)
31
- faraday-patron (1.0.0)
32
- faraday-rack (1.0.0)
33
- gitlab (4.17.0)
34
- httparty (~> 0.18)
35
- terminal-table (~> 1.5, >= 1.5.1)
17
+ faraday-net_http (3.0.0)
18
+ gitlab (4.19.0)
19
+ httparty (~> 0.20)
20
+ terminal-table (>= 1.5.1)
36
21
  httparty (0.20.0)
37
22
  mime-types (~> 3.0)
38
23
  multi_xml (>= 0.5.2)
39
24
  mime-types (3.4.1)
40
25
  mime-types-data (~> 3.2015)
41
- mime-types-data (3.2021.1115)
26
+ mime-types-data (3.2022.0105)
42
27
  multi_xml (0.6.0)
43
- multipart-post (2.1.1)
44
- octokit (4.21.0)
45
- faraday (>= 0.9)
46
- sawyer (~> 0.8.0, >= 0.5.3)
28
+ octokit (4.25.1)
29
+ faraday (>= 1, < 3)
30
+ sawyer (~> 0.9)
47
31
  parallel (1.21.0)
48
32
  parser (3.0.2.0)
49
33
  ast (~> 2.4.1)
@@ -55,7 +39,7 @@ GEM
55
39
  rexml (~> 3.2)
56
40
  rugged (>= 0.23.0, < 1.1.0)
57
41
  thor (>= 0.20.3, < 2.0)
58
- public_suffix (4.0.6)
42
+ public_suffix (5.0.0)
59
43
  rainbow (3.0.0)
60
44
  rake (13.0.6)
61
45
  regexp_parser (2.1.1)
@@ -94,12 +78,12 @@ GEM
94
78
  ruby-progressbar (1.11.0)
95
79
  ruby2_keywords (0.0.5)
96
80
  rugged (1.0.1)
97
- sawyer (0.8.2)
81
+ sawyer (0.9.2)
98
82
  addressable (>= 2.3.5)
99
- faraday (> 0.8, < 2.0)
100
- terminal-table (1.8.0)
101
- unicode-display_width (~> 1.1, >= 1.1.1)
102
- thor (1.1.0)
83
+ faraday (>= 0.17.3, < 3)
84
+ terminal-table (3.0.2)
85
+ unicode-display_width (>= 1.1.1, < 3)
86
+ thor (1.2.1)
103
87
  unicode-display_width (1.8.0)
104
88
 
105
89
  PLATFORMS
@@ -115,4 +99,4 @@ DEPENDENCIES
115
99
  rubocop-rspec
116
100
 
117
101
  BUNDLED WITH
118
- 2.2.31
102
+ 2.3.10
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Pronto
4
4
  module RailsMigrationsAnnotatedVersion
5
- VERSION = "0.0.3"
5
+ VERSION = "0.0.5"
6
6
  end
7
7
  end
@@ -97,7 +97,7 @@ module Pronto
97
97
  end
98
98
 
99
99
  def check_structure_migration_version_numbers
100
- return unless migration_patches.any?
100
+ # return unless migration_patches.any?
101
101
 
102
102
  structure_file_name = "db/structure.sql"
103
103
  return if !File.exist?(structure_file_name) || gitignored?(structure_file_name)
@@ -108,7 +108,7 @@ module Pronto
108
108
  check_structure_versions_present(versions_from_schema)
109
109
  check_structure_migration_missing
110
110
 
111
- check_structure_versions_syntax(versions_from_schema)
111
+ check_structure_versions_syntax(versions_from_schema) if versions_from_schema.any?
112
112
  check_structure_versions_sorted(versions_from_schema)
113
113
  check_structure_ending(structure_file_lines)
114
114
  end
@@ -129,14 +129,22 @@ module Pronto
129
129
 
130
130
  def check_structure_migration_missing
131
131
  structure_patches.each do |patch|
132
+ next if patch.delta.old_file[:oid] == "0000000000000000000000000000000000000000" # new structure.sql file
133
+
134
+ triggered = false
132
135
  patch.added_lines.select { |line| line.content.match?(migration_line_regex) }.each do |line|
133
136
  version = line.content.match(migration_line_regex)[:version]
134
137
  next if migration_version_numbers.include?(version)
135
- next if line.content.end_with?(",") &&
138
+ next if line.content.end_with?(",\n") &&
136
139
  patch.deleted_lines.any? { |del| del.content.include?("#{version}');") }
137
140
 
141
+ triggered = true
138
142
  add_message_at_patch(patch, "Migration #{version} is not present in this changeset", :error, line: line)
139
143
  end
144
+
145
+ if !triggered && migration_version_numbers.none?
146
+ add_message_at_patch(patch, "structure.sql changed without migrations", :error, line: patch.lines.first)
147
+ end
140
148
  end
141
149
  end
142
150
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pronto-rails_migrations_annotated
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vasily Fedoseyev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-15 00:00:00.000000000 Z
11
+ date: 2022-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pronto
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  - !ruby/object:Gem::Version
65
65
  version: '0'
66
66
  requirements: []
67
- rubygems_version: 3.0.9
67
+ rubygems_version: 3.1.6
68
68
  signing_key:
69
69
  specification_version: 4
70
70
  summary: Pronto runner to check rails migrations to be separate from other code, but