immosquare-cleaner 0.1.95 → 0.1.97
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/lib/immosquare-cleaner/version.rb +1 -1
- data/linters/erb-lint-4.0.0.yml +18 -0
- data/linters/normalize-comments.mjs +26 -4
- data/linters/rubocop-4.0.0.yml +196 -0
- data/package.json +5 -5
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 06c658b98e0ab281d6994551ab72051c50272afcacc13f00692db0f9d8e80572
|
|
4
|
+
data.tar.gz: d09f8d5b8a1d5ee390c2eda3684f7beb36f743e52ba3ffd17fdfcb77fa782d57
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fddf3c000d3505a33b2cb2e82bc7f23855d17d3500a5f87dc782d97dfb94affb52d7ab5791700b47e0b0026b0c38432acf00a5fa285fd7cea0a56ed621e9dc0e
|
|
7
|
+
data.tar.gz: 3f22282338b7e82e30206cb4af8b1d01809cb74e1836f1f7bade8b1632afae72740530280915723623d092e87bf2661b4086d3b3c91e048ef232affba39e927c
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
EnableDefaultLinters: true
|
|
3
|
+
linters:
|
|
4
|
+
NoJavascriptTagHelper:
|
|
5
|
+
enabled: false
|
|
6
|
+
SpaceInHtmlTag:
|
|
7
|
+
enabled: false
|
|
8
|
+
CustomSingleLineIfModifier:
|
|
9
|
+
enabled: true
|
|
10
|
+
CustomHtmlToContentTag:
|
|
11
|
+
enabled: true
|
|
12
|
+
Rubocop:
|
|
13
|
+
enabled: true
|
|
14
|
+
rubocop_config:
|
|
15
|
+
inherit_from:
|
|
16
|
+
- linters/rubocop-4.0.0.yml
|
|
17
|
+
Layout/TrailingWhitespace:
|
|
18
|
+
Enabled: false
|
|
@@ -36,6 +36,7 @@ const normalizeComments = (filePath) => {
|
|
|
36
36
|
// Process blocks in reverse order to avoid line number shifts
|
|
37
37
|
//============================================================//
|
|
38
38
|
const blocksReversed = [...commentBlocks].reverse()
|
|
39
|
+
let hasChanges = false
|
|
39
40
|
|
|
40
41
|
blocksReversed.forEach((block) => {
|
|
41
42
|
const normalized = normalizeCommentBlock(block, lines)
|
|
@@ -47,10 +48,16 @@ const normalizeComments = (filePath) => {
|
|
|
47
48
|
// Replace the lines in the original array
|
|
48
49
|
//============================================================//
|
|
49
50
|
lines.splice(startLine, endLine - startLine + 1, ...normalized)
|
|
51
|
+
hasChanges = true
|
|
50
52
|
}
|
|
51
53
|
})
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
//============================================================//
|
|
56
|
+
// Only write if there were changes
|
|
57
|
+
//============================================================//
|
|
58
|
+
if (hasChanges) {
|
|
59
|
+
writeFileSync(filePath, lines.join("\n"))
|
|
60
|
+
}
|
|
54
61
|
}
|
|
55
62
|
|
|
56
63
|
//============================================================//
|
|
@@ -64,7 +71,7 @@ const groupConsecutiveComments = (comments, originalLines) => {
|
|
|
64
71
|
|
|
65
72
|
comments.forEach((comment) => {
|
|
66
73
|
//============================================================//
|
|
67
|
-
// Only process line comments (// style), not block comments
|
|
74
|
+
// Only process line comments (// style), not block comments
|
|
68
75
|
//============================================================//
|
|
69
76
|
if (comment.type !== "CommentLine") {
|
|
70
77
|
if (currentBlock.length > 0) {
|
|
@@ -89,8 +96,9 @@ const groupConsecutiveComments = (comments, originalLines) => {
|
|
|
89
96
|
|
|
90
97
|
//============================================================//
|
|
91
98
|
// Skip Sprockets directives (//= link, //= require, etc.)
|
|
99
|
+
// These start with "= " followed by a directive keyword
|
|
92
100
|
//============================================================//
|
|
93
|
-
if (comment.value
|
|
101
|
+
if (/^=\s*\w/.test(comment.value)) {
|
|
94
102
|
if (currentBlock.length > 0) {
|
|
95
103
|
blocks.push(currentBlock)
|
|
96
104
|
currentBlock = []
|
|
@@ -149,7 +157,7 @@ const normalizeCommentBlock = (block, originalLines) => {
|
|
|
149
157
|
const indent = firstLine.match(/^(\s*)/)[1]
|
|
150
158
|
|
|
151
159
|
//============================================================//
|
|
152
|
-
// Extract the text content from each comment
|
|
160
|
+
// Extract the text content from each comment (skip borders)
|
|
153
161
|
//============================================================//
|
|
154
162
|
const bodyLines = []
|
|
155
163
|
let firstLineWithTextFound = false
|
|
@@ -189,6 +197,20 @@ const normalizeCommentBlock = (block, originalLines) => {
|
|
|
189
197
|
})
|
|
190
198
|
result.push(indent + BORDER_LINE)
|
|
191
199
|
|
|
200
|
+
//============================================================//
|
|
201
|
+
// Compare with existing - skip if already correctly formatted
|
|
202
|
+
//============================================================//
|
|
203
|
+
const startLine = block[0].loc.start.line - 1
|
|
204
|
+
const endLine = block[block.length - 1].loc.start.line - 1
|
|
205
|
+
const existingLines = originalLines.slice(startLine, endLine + 1)
|
|
206
|
+
|
|
207
|
+
//============================================================//
|
|
208
|
+
// Check if existing lines match the result exactly
|
|
209
|
+
//============================================================//
|
|
210
|
+
if (existingLines.length === result.length && existingLines.every((line, i) => line === result[i])) {
|
|
211
|
+
return null
|
|
212
|
+
}
|
|
213
|
+
|
|
192
214
|
return result
|
|
193
215
|
}
|
|
194
216
|
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
---
|
|
2
|
+
require:
|
|
3
|
+
- rubocop/cop/style/method_call_with_args_parentheses_override
|
|
4
|
+
- rubocop/cop/custom_cops/style/comment_normalization
|
|
5
|
+
- rubocop/cop/custom_cops/style/font_awesome_normalization
|
|
6
|
+
- rubocop/cop/custom_cops/style/align_assignments
|
|
7
|
+
AllCops:
|
|
8
|
+
NewCops: enable
|
|
9
|
+
EnabledByDefault: false
|
|
10
|
+
UseCache: true
|
|
11
|
+
SuggestExtensions: false
|
|
12
|
+
ActiveSupportExtensionsEnabled: true
|
|
13
|
+
TargetRubyVersion: 4.0.0
|
|
14
|
+
ParserEngine: parser_prism
|
|
15
|
+
Metrics:
|
|
16
|
+
Enabled: false
|
|
17
|
+
Lint/UselessAssignment:
|
|
18
|
+
Enabled: false
|
|
19
|
+
Lint/RescueException:
|
|
20
|
+
Enabled: false
|
|
21
|
+
Lint/UnusedMethodArgument:
|
|
22
|
+
Enabled: false
|
|
23
|
+
Naming/VariableNumber:
|
|
24
|
+
Enabled: false
|
|
25
|
+
Naming/FileName:
|
|
26
|
+
Enabled: false
|
|
27
|
+
Naming/MethodParameterName:
|
|
28
|
+
MinNameLength: 1
|
|
29
|
+
Layout/LeadingEmptyLines:
|
|
30
|
+
Enabled: false
|
|
31
|
+
Layout/InitialIndentation:
|
|
32
|
+
Enabled: false
|
|
33
|
+
Layout/TrailingEmptyLines:
|
|
34
|
+
Enabled: false
|
|
35
|
+
Layout/ExtraSpacing:
|
|
36
|
+
Enabled: false
|
|
37
|
+
Layout/LineLength:
|
|
38
|
+
Enabled: false
|
|
39
|
+
Layout/TrailingWhitespace:
|
|
40
|
+
Enabled: true
|
|
41
|
+
Layout/EmptyLines:
|
|
42
|
+
Enabled: false
|
|
43
|
+
Layout/SpaceInsideBlockBraces:
|
|
44
|
+
SpaceBeforeBlockParameters: false
|
|
45
|
+
Layout/EmptyLinesAroundClassBody:
|
|
46
|
+
EnforcedStyle: empty_lines
|
|
47
|
+
Layout/FirstHashElementIndentation:
|
|
48
|
+
EnforcedStyle: consistent
|
|
49
|
+
Layout/ArgumentAlignment:
|
|
50
|
+
EnforcedStyle: with_fixed_indentation
|
|
51
|
+
Layout/HashAlignment:
|
|
52
|
+
EnforcedHashRocketStyle: table
|
|
53
|
+
Layout/MultilineAssignmentLayout:
|
|
54
|
+
EnforcedStyle: same_line
|
|
55
|
+
Layout/SpaceInsideHashLiteralBraces:
|
|
56
|
+
EnforcedStyle: no_space
|
|
57
|
+
Layout/MultilineMethodCallIndentation:
|
|
58
|
+
EnforcedStyle: indented
|
|
59
|
+
Style/CombinableLoops:
|
|
60
|
+
Enabled: false
|
|
61
|
+
Style/SingleArgumentDig:
|
|
62
|
+
Enabled: false
|
|
63
|
+
Style/RedundantBegin:
|
|
64
|
+
Enabled: false
|
|
65
|
+
Style/MultilineTernaryOperator:
|
|
66
|
+
Enabled: false
|
|
67
|
+
Style/NestedTernaryOperator:
|
|
68
|
+
Enabled: false
|
|
69
|
+
Style/MultilineIfModifier:
|
|
70
|
+
Enabled: false
|
|
71
|
+
Style/FrozenStringLiteralComment:
|
|
72
|
+
Enabled: false
|
|
73
|
+
Style/Next:
|
|
74
|
+
Enabled: false
|
|
75
|
+
Style/Documentation:
|
|
76
|
+
Enabled: false
|
|
77
|
+
Style/IfUnlessModifierOfIfUnless:
|
|
78
|
+
Enabled: false
|
|
79
|
+
Style/NegatedIf:
|
|
80
|
+
Enabled: false
|
|
81
|
+
Style/FormatStringToken:
|
|
82
|
+
EnforcedStyle: template
|
|
83
|
+
Style/NumericPredicate:
|
|
84
|
+
EnforcedStyle: comparison
|
|
85
|
+
Style/StringLiterals:
|
|
86
|
+
EnforcedStyle: double_quotes
|
|
87
|
+
Style/StringLiteralsInInterpolation:
|
|
88
|
+
EnforcedStyle: double_quotes
|
|
89
|
+
Style/HashSyntax:
|
|
90
|
+
EnforcedStyle: hash_rockets
|
|
91
|
+
Style/WordArray:
|
|
92
|
+
EnforcedStyle: brackets
|
|
93
|
+
Style/SymbolArray:
|
|
94
|
+
EnforcedStyle: brackets
|
|
95
|
+
Style/RescueModifier:
|
|
96
|
+
Enabled: false
|
|
97
|
+
Style/MethodCallWithArgsParentheses:
|
|
98
|
+
Enabled: true
|
|
99
|
+
EnforcedStyle: require_parentheses
|
|
100
|
+
IgnoreMacros: false
|
|
101
|
+
AllowedMethods:
|
|
102
|
+
- require
|
|
103
|
+
- require_relative
|
|
104
|
+
- include
|
|
105
|
+
- extend
|
|
106
|
+
- prepend
|
|
107
|
+
- raise
|
|
108
|
+
- fail
|
|
109
|
+
- yield
|
|
110
|
+
- attr_accessor
|
|
111
|
+
- attr_reader
|
|
112
|
+
- attr_writer
|
|
113
|
+
- run
|
|
114
|
+
- exec
|
|
115
|
+
- load
|
|
116
|
+
- gem
|
|
117
|
+
- group
|
|
118
|
+
- source
|
|
119
|
+
- ruby
|
|
120
|
+
- install_plugin
|
|
121
|
+
- desc
|
|
122
|
+
- task
|
|
123
|
+
- namespace
|
|
124
|
+
- before_action
|
|
125
|
+
- after_action
|
|
126
|
+
- around_action
|
|
127
|
+
- skip_before_action
|
|
128
|
+
- prepend_before_action
|
|
129
|
+
- append_before_action
|
|
130
|
+
- helper_method
|
|
131
|
+
- layout
|
|
132
|
+
- rescue_from
|
|
133
|
+
- belongs_to
|
|
134
|
+
- has_many
|
|
135
|
+
- has_one
|
|
136
|
+
- has_and_belongs_to_many
|
|
137
|
+
- validates
|
|
138
|
+
- validate
|
|
139
|
+
- validates_presence_of
|
|
140
|
+
- validates_uniqueness_of
|
|
141
|
+
- validates_length_of
|
|
142
|
+
- validates_format_of
|
|
143
|
+
- validates_numericality_of
|
|
144
|
+
- validates_inclusion_of
|
|
145
|
+
- validates_exclusion_of
|
|
146
|
+
- validates_confirmation_of
|
|
147
|
+
- validates_acceptance_of
|
|
148
|
+
- validates_absence_of
|
|
149
|
+
- validates_associated
|
|
150
|
+
- validates_each
|
|
151
|
+
- validates_with
|
|
152
|
+
- after_initialize
|
|
153
|
+
- after_find
|
|
154
|
+
- before_validation
|
|
155
|
+
- after_validation
|
|
156
|
+
- before_save
|
|
157
|
+
- after_save
|
|
158
|
+
- around_save
|
|
159
|
+
- before_create
|
|
160
|
+
- after_create
|
|
161
|
+
- around_create
|
|
162
|
+
- before_update
|
|
163
|
+
- after_update
|
|
164
|
+
- around_update
|
|
165
|
+
- before_destroy
|
|
166
|
+
- after_destroy
|
|
167
|
+
- around_destroy
|
|
168
|
+
- after_touch
|
|
169
|
+
- after_commit
|
|
170
|
+
- after_rollback
|
|
171
|
+
- delegate
|
|
172
|
+
- enum
|
|
173
|
+
- get
|
|
174
|
+
- post
|
|
175
|
+
- put
|
|
176
|
+
- patch
|
|
177
|
+
- delete
|
|
178
|
+
- options
|
|
179
|
+
- head
|
|
180
|
+
- match
|
|
181
|
+
- root
|
|
182
|
+
- rake
|
|
183
|
+
- every
|
|
184
|
+
- command
|
|
185
|
+
- set
|
|
186
|
+
- append
|
|
187
|
+
- server
|
|
188
|
+
- after
|
|
189
|
+
CustomCops/Style/CommentNormalization:
|
|
190
|
+
Enabled: true
|
|
191
|
+
CustomCops/Style/FontAwesomeNormalization:
|
|
192
|
+
Enabled: true
|
|
193
|
+
CustomCops/Style/AlignAssignments:
|
|
194
|
+
Enabled: false
|
|
195
|
+
Gemspec/RequireMFA:
|
|
196
|
+
Enabled: false
|
data/package.json
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
"name": "immosquare-cleaner",
|
|
3
3
|
"private": true,
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@babel/parser": "^7.28.
|
|
6
|
-
"@eslint/js": "^9.39.
|
|
7
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
8
|
-
"@typescript-eslint/parser": "^8.
|
|
9
|
-
"eslint": "^9.39.
|
|
5
|
+
"@babel/parser": "^7.28.6",
|
|
6
|
+
"@eslint/js": "^9.39.2",
|
|
7
|
+
"@typescript-eslint/eslint-plugin": "^8.53.0",
|
|
8
|
+
"@typescript-eslint/parser": "^8.53.0",
|
|
9
|
+
"eslint": "^9.39.2",
|
|
10
10
|
"eslint-plugin-align-assignments": "^1.1.2",
|
|
11
11
|
"eslint-plugin-align-import": "^1.0.0",
|
|
12
12
|
"eslint-plugin-erb": "^2.1.1",
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: immosquare-cleaner
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.97
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- immosquare
|
|
@@ -148,6 +148,7 @@ files:
|
|
|
148
148
|
- lib/immosquare-cleaner/version.rb
|
|
149
149
|
- lib/tasks/immosquare_cleaner.rake
|
|
150
150
|
- linters/erb-lint-3.4.1.yml
|
|
151
|
+
- linters/erb-lint-4.0.0.yml
|
|
151
152
|
- linters/erb-lint.yml
|
|
152
153
|
- linters/erb_lint/custom_html_to_content_tag.rb
|
|
153
154
|
- linters/erb_lint/custom_single_line_if_modifier.rb
|
|
@@ -155,6 +156,7 @@ files:
|
|
|
155
156
|
- linters/normalize-comments.mjs
|
|
156
157
|
- linters/prettier.yml
|
|
157
158
|
- linters/rubocop-3.4.1.yml
|
|
159
|
+
- linters/rubocop-4.0.0.yml
|
|
158
160
|
- linters/rubocop.yml
|
|
159
161
|
- linters/rubocop/cop/custom_cops/style/align_assignments.rb
|
|
160
162
|
- linters/rubocop/cop/custom_cops/style/comment_normalization.rb
|
|
@@ -180,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
180
182
|
- !ruby/object:Gem::Version
|
|
181
183
|
version: '0'
|
|
182
184
|
requirements: []
|
|
183
|
-
rubygems_version: 4.0.
|
|
185
|
+
rubygems_version: 4.0.3
|
|
184
186
|
specification_version: 4
|
|
185
187
|
summary: A gem to lint and organize files in a Rails application.
|
|
186
188
|
test_files: []
|