rubocop-asjer 0.4.2 → 0.4.4
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/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +14 -0
- data/config/default.yml +5 -0
- data/lib/rubocop/asjer/version.rb +1 -1
- data/lib/rubocop/cop/asjer/rails_class_order.rb +15 -2
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fce3144090cd112f10269b07afe0ad4767c22504b5f836d39b0b0e0dcb8aa19f
|
|
4
|
+
data.tar.gz: cb5b00b095467921f8bf67fd6fb164d818cab82d7ab16b74b60e5f2243ace66f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b66f0965a6e22d55c9f0cc6a7b7360bc4d2476d765aba303141a16d131e1f6fee037fccb9984e6bb6950ba412261e90ab5673ac5cbb589279a1184f4c57a3e9a
|
|
7
|
+
data.tar.gz: 40017018dd2d295869f733c722e6999cecfb6afdf6bcbb4272066f87d1345723471717c5934d57b3b1011b7566cb6c5d5ea1080b4b8a17ac7bae934c7f2870d8
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.4.4](https://github.com/asjer/rubocop-asjer/compare/v0.4.3...v0.4.4) (2026-02-10)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* prevent excessive blank lines after autocorrect in `RailsClassOrder` cop ([56f6def](https://github.com/asjer/rubocop-asjer/commit/56f6deff1fab470ea5c7deac175d1d0088cd11f5))
|
|
9
|
+
|
|
10
|
+
## [0.4.3](https://github.com/asjer/rubocop-asjer/compare/v0.4.2...v0.4.3) (2026-01-28)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* add 5 missing transactional callback shortcuts to `RailsClassOrder` cop ([9831a59](https://github.com/asjer/rubocop-asjer/commit/9831a592d9b25d9756dff93af7654c027f779964))
|
|
16
|
+
|
|
3
17
|
## [0.4.2](https://github.com/asjer/rubocop-asjer/compare/v0.4.1...v0.4.2) (2026-01-28)
|
|
4
18
|
|
|
5
19
|
|
data/config/default.yml
CHANGED
|
@@ -65,8 +65,13 @@ Asjer/RailsClassOrder:
|
|
|
65
65
|
- before_destroy
|
|
66
66
|
- around_destroy
|
|
67
67
|
- after_destroy
|
|
68
|
+
- before_commit
|
|
68
69
|
- after_commit
|
|
69
70
|
- after_rollback
|
|
71
|
+
- after_save_commit
|
|
72
|
+
- after_create_commit
|
|
73
|
+
- after_update_commit
|
|
74
|
+
- after_destroy_commit
|
|
70
75
|
Others:
|
|
71
76
|
- encrypts
|
|
72
77
|
- normalizes
|
|
@@ -79,7 +79,8 @@ module RuboCop
|
|
|
79
79
|
before_update around_update after_update
|
|
80
80
|
after_save
|
|
81
81
|
before_destroy around_destroy after_destroy
|
|
82
|
-
after_commit after_rollback
|
|
82
|
+
before_commit after_commit after_rollback
|
|
83
|
+
after_save_commit after_create_commit after_update_commit after_destroy_commit
|
|
83
84
|
].freeze
|
|
84
85
|
|
|
85
86
|
OTHERS = %w[
|
|
@@ -128,7 +129,19 @@ module RuboCop
|
|
|
128
129
|
source = processed_source.buffer.source
|
|
129
130
|
line_start = source.rindex("\n", range.begin_pos - 1)&.+(1) || 0
|
|
130
131
|
end_pos = source[range.end_pos] == "\n" ? range.end_pos + 1 : range.end_pos
|
|
131
|
-
|
|
132
|
+
|
|
133
|
+
range_between(line_start, skip_trailing_blank_lines(source, end_pos))
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def skip_trailing_blank_lines(source, pos)
|
|
137
|
+
while pos < source.length
|
|
138
|
+
line_end = source.index("\n", pos)
|
|
139
|
+
break unless line_end
|
|
140
|
+
break unless source[pos...line_end].strip.empty?
|
|
141
|
+
|
|
142
|
+
pos = line_end + 1
|
|
143
|
+
end
|
|
144
|
+
pos
|
|
132
145
|
end
|
|
133
146
|
|
|
134
147
|
def build_sorted_source(sorted, original)
|