rubocop-gradual 0.3.1 → 0.3.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dfbc47ff52ccb93118ada746e311ca665d8349feeae4c54e619269923c8b4be0
4
- data.tar.gz: c2c847431317fefce00aabe966bf05f4443c906c71c6933adebfacbcc6746d18
3
+ metadata.gz: ad8fc07a5efc9411a388f7fd1eab366bacd44466ea7d268596b22d2c8a42522c
4
+ data.tar.gz: 618f6421cca7465ec6b3bfa08fd0a97eda8cf642c605ec8010a944f406d7b8bd
5
5
  SHA512:
6
- metadata.gz: f7634eaf9c309ccc616a5c8beb724950916e5fa655bb3f9d1658ebfe208393135cd81a06bdbbc2191043762e2b75b38c67d5b9a52cb8317d317204d3cce9ebea
7
- data.tar.gz: ffd86c21f9054a2d7ddeb87a7ff21e126fe16779a2fada774972ad54ff2f0f287846fb2aaea358ea43ff5930e58ef795b90271c4e7c6a1bf5cba4316974c5560
6
+ metadata.gz: 14a9f2ae2e16a42171257db3d466eb99228e2a094c4e453725a3e07136f09a6d028bd080e158da47efbdbd012e57e8641ee259ff296df388f8515e3da14cbc23
7
+ data.tar.gz: f8c0d7a36a2f616893bbcdc681f775989b3b376ecdacc6383bdb8ca417fd08b82f06d9f19955b3c2decbb32d4f159fb2957f47b0a518ae22fb29f48e11fa4f4c
data/CHANGELOG.md CHANGED
@@ -7,13 +7,25 @@ and this project adheres to [Semantic Versioning].
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.3.3] - 2023-10-18
11
+
12
+ ### Fixed
13
+
14
+ - Throw an error when the `--check` option is used and file hash is outdated. ([@skryukov])
15
+ - Wrap RuboCop errors to make output more pleasant. ([@skryukov])
16
+
17
+ ## [0.3.2] - 2023-10-10
18
+
19
+ ### Fixed
20
+
21
+ - Handle syntax errors in inspected files. ([@skryukov])
22
+
10
23
  ## [0.3.1] - 2022-11-29
11
24
 
12
25
  ### Fixed
13
26
 
14
27
  - More straightforward way of including RuboCop patch for Require mode. ([@skryukov])
15
28
 
16
-
17
29
  ## [0.3.0] - 2022-10-26
18
30
 
19
31
  ### Added
@@ -87,7 +99,9 @@ RuboCop::Gradual::RakeTask.new
87
99
 
88
100
  [@skryukov]: https://github.com/skryukov
89
101
 
90
- [Unreleased]: https://github.com/skryukov/rubocop-gradual/compare/v0.3.1...HEAD
102
+ [Unreleased]: https://github.com/skryukov/rubocop-gradual/compare/v0.3.3...HEAD
103
+ [0.3.3]: https://github.com/skryukov/rubocop-gradual/compare/v0.3.2...v0.3.3
104
+ [0.3.2]: https://github.com/skryukov/rubocop-gradual/compare/v0.3.1...v0.3.2
91
105
  [0.3.1]: https://github.com/skryukov/rubocop-gradual/compare/v0.3.0...v0.3.1
92
106
  [0.3.0]: https://github.com/skryukov/rubocop-gradual/compare/v0.2.0...v0.3.0
93
107
  [0.2.0]: https://github.com/skryukov/rubocop-gradual/compare/v0.1.1...v0.2.0
@@ -18,6 +18,9 @@ module RuboCop
18
18
  puts "Finished Gradual processing in #{time} seconds" if Configuration.display_time?
19
19
 
20
20
  exit_code
21
+ rescue RuboCop::Error => e
22
+ warn "\nRuboCop Error: #{e.message}"
23
+ 1
21
24
  end
22
25
 
23
26
  private
@@ -41,17 +41,18 @@ module RuboCop
41
41
  end
42
42
 
43
43
  def diff_issues(diff, result_file, old_file)
44
- fixed_or_moved_issues = old_file.changed_issues(result_file)
45
- new_or_moved_issues = result_file.changed_issues(old_file)
46
- moved_issues, fixed_issues = split_issues(fixed_or_moved_issues, new_or_moved_issues)
47
-
48
- diff.add_issues(
49
- result_file.path,
50
- fixed: fixed_issues,
51
- moved: moved_issues,
52
- new: new_or_moved_issues - moved_issues,
53
- unchanged: result_file.issues - new_or_moved_issues - moved_issues
54
- )
44
+ fixed_or_moved = old_file.changed_issues(result_file)
45
+ new_or_moved = result_file.changed_issues(old_file)
46
+ moved, fixed = split_issues(fixed_or_moved, new_or_moved)
47
+ new = new_or_moved - moved
48
+ unchanged = result_file.issues - new - moved
49
+
50
+ if result_file.file_hash != old_file.file_hash && fixed.empty? && new.empty? && moved.empty?
51
+ moved = unchanged
52
+ unchanged = []
53
+ end
54
+
55
+ diff.add_issues(result_file.path, fixed: fixed, moved: moved, new: new, unchanged: unchanged)
55
56
  end
56
57
 
57
58
  def split_issues(fixed_or_moved_issues, new_or_moved_issues)
@@ -42,11 +42,12 @@ module RuboCop
42
42
  code = ""
43
43
  data.each_line.lazy.drop(line).each_with_index do |str, index|
44
44
  from = index.zero? ? column : 0
45
- length = index.zero? ? length : length - code.length
45
+ length -= code.length unless index.zero?
46
46
  code += str[from, length]
47
47
 
48
- return code if code.length >= length
48
+ break if code.length >= length
49
49
  end
50
+ code
50
51
  end
51
52
 
52
53
  def data
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Gradual
5
- VERSION = "0.3.1"
5
+ VERSION = "0.3.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-gradual
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Svyatoslav Kryukov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-11-29 00:00:00.000000000 Z
11
+ date: 2023-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs
@@ -94,7 +94,7 @@ dependencies:
94
94
  version: '1.0'
95
95
  description: Gradually improve your code with RuboCop.
96
96
  email:
97
- - s.g.kryukov@yandex.ru
97
+ - me@skryukov.dev
98
98
  executables:
99
99
  - rubocop-gradual
100
100
  extensions: []