gemwork 0.7.8 → 0.7.11
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/CHANGELOG.md +11 -0
- data/README.md +31 -5
- data/lib/erb_lint/.erb_lint.yml +35 -0
- data/lib/gemwork/version.rb +1 -1
- data/lib/tasks/brakeman.rake +15 -6
- data/lib/tasks/erb_lint.rake +7 -0
- data/lib/tasks/rubocop.rake +1 -1
- 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: d2e343966a1395439c2480be144d1b021e71b3b393e2c5a37a3e042fb9d9e26a
|
4
|
+
data.tar.gz: c4394858040c87beaf9721891e99f28b46673c40ebdd77bc5640f610bf7ad33c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b64fd4b8b8fd79164d315ec7ec04f7ca0b2211f860c92878c11d3e157e30c376110394a72ebddfce515c1393ebe7ab31741dfe2c7fdb428f3f13c960182c899
|
7
|
+
data.tar.gz: 767a780744a8429e0fe7682380e36dc5452205e6f2c2e1c28f9c7c9c64c2fae1f07cc58e672ab1230baa7d5062b572f807f40f20be1b610e9cb4ee247e879cef
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
## [Unreleased]
|
2
2
|
|
3
|
+
## [0.7.11] - 2025-2-15
|
4
|
+
(0.7.10 yanked)
|
5
|
+
|
6
|
+
- Minimize `rake brakeman` output when no warnings; return failure otherwise
|
7
|
+
- Fail on error in Rubocop rake task
|
8
|
+
- Add documentation to README + example config file for erb_lint
|
9
|
+
|
10
|
+
## [0.7.9] - 2025-2-13
|
11
|
+
|
12
|
+
- Add rake task for `erb_lint` for Rails apps
|
13
|
+
|
3
14
|
## [0.7.8] - 2025-2-12
|
4
15
|
|
5
16
|
- Ignore `create` and `update` methods (controller actions) for Metrics/MethodLength cop
|
data/README.md
CHANGED
@@ -58,7 +58,7 @@ Running `rake -T` after this will reveal the additional tasks defined by Gemwork
|
|
58
58
|
|
59
59
|
### Rails
|
60
60
|
|
61
|
-
For a Rails project, you may need to conditionally run the above by returning early unless the current environment is development. Further, you may want to include other tasks, such as `eslint
|
61
|
+
For a Rails project, you may need to conditionally run the above by returning early unless the current environment is development. Further, you may want to include other gems & their rake tasks, such as: [`erb_lint`](#erb_lint), [`eslint`](#eslint), [`prettier`](#prettier), `brakeman`, and `test:system`.
|
62
62
|
|
63
63
|
```ruby
|
64
64
|
# frozen_string_literal: true
|
@@ -69,8 +69,9 @@ spec = Gem::Specification.find_by_name("gemwork")
|
|
69
69
|
|
70
70
|
# Load additional tasks defined by Gemwork.
|
71
71
|
Dir.glob(
|
72
|
-
Pathname.new(spec.gem_dir).
|
73
|
-
|
72
|
+
Pathname.new(spec.gem_dir).join(
|
73
|
+
"lib/tasks",
|
74
|
+
"{util,rubocop,erb_lint,reek,eslint,prettier,brakeman}.rake")) do |task|
|
74
75
|
load(task)
|
75
76
|
end
|
76
77
|
|
@@ -80,6 +81,7 @@ task :default do
|
|
80
81
|
run_tasks(%i[
|
81
82
|
test
|
82
83
|
rubocop
|
84
|
+
erb_lint
|
83
85
|
reek
|
84
86
|
eslint
|
85
87
|
prettier
|
@@ -214,11 +216,34 @@ require "gemwork/test/support/spec_dsl"
|
|
214
216
|
|
215
217
|
For a Rails app, additional configuration may be desired to improve linter support.
|
216
218
|
|
219
|
+
#### erb_lint
|
220
|
+
|
221
|
+
https://github.com/Shopify/erb_lint
|
222
|
+
|
223
|
+
Install with:
|
224
|
+
|
225
|
+
```
|
226
|
+
group :development do
|
227
|
+
gem "erb_lint", require: false
|
228
|
+
end
|
229
|
+
```
|
230
|
+
|
231
|
+
Add [.erb_lint.yml](https://github.com/pdobb/gemwork/blob/main/lib/erb_lint/.erb_lint.yml) to the Rails project's root.
|
232
|
+
|
233
|
+
Run with:
|
234
|
+
|
235
|
+
```bash
|
236
|
+
rake erb_lint
|
237
|
+
|
238
|
+
# To run on manually, on a specific path:
|
239
|
+
erb_lint --format=compact path/to/template.html.erb
|
240
|
+
```
|
241
|
+
|
217
242
|
#### eslint
|
218
243
|
|
219
244
|
The below fixes eslint linting errors in Rails (7+, ...) projects.
|
220
245
|
|
221
|
-
```
|
246
|
+
```javascript
|
222
247
|
// .eslintrc.json
|
223
248
|
|
224
249
|
{
|
@@ -247,7 +272,7 @@ General config recommendations for prettier:
|
|
247
272
|
vendor
|
248
273
|
```
|
249
274
|
|
250
|
-
```
|
275
|
+
```javascript
|
251
276
|
// .prettierrc.json
|
252
277
|
|
253
278
|
{
|
@@ -286,6 +311,7 @@ For Rails projects, you may want to manually install additional gems as well:
|
|
286
311
|
|
287
312
|
- [rubocop-rails](https://github.com/rubocop/rubocop-rails) -- A RuboCop extension focused on enforcing Rails best practices and coding conventions.
|
288
313
|
- [rubocop-capybara](https://github.com/rubocop/rubocop-capybara) -- Code style checking for Capybara files.
|
314
|
+
- [erb_lint](https://github.com/Shopify/erb_lint) -- erb linting, including with Rubocop
|
289
315
|
|
290
316
|
## Development
|
291
317
|
|
@@ -0,0 +1,35 @@
|
|
1
|
+
EnableDefaultLinters: true
|
2
|
+
linters:
|
3
|
+
DeprecatedClasses:
|
4
|
+
enabled: false
|
5
|
+
ErbSafety:
|
6
|
+
enabled: true
|
7
|
+
HardCodedString:
|
8
|
+
enabled: false
|
9
|
+
PartialInstanceVariable:
|
10
|
+
enabled: true
|
11
|
+
Rubocop:
|
12
|
+
enabled: true
|
13
|
+
rubocop_config:
|
14
|
+
inherit_from:
|
15
|
+
- .rubocop.yml
|
16
|
+
Layout/InitialIndentation:
|
17
|
+
Enabled: false
|
18
|
+
Layout/LeadingEmptyLines:
|
19
|
+
Enabled: false
|
20
|
+
Layout/MultilineArrayLineBreaks:
|
21
|
+
Enabled: false
|
22
|
+
Layout/TrailingEmptyLines:
|
23
|
+
Enabled: false
|
24
|
+
Layout/TrailingWhitespace:
|
25
|
+
Enabled: false
|
26
|
+
Lint/UselessAssignment:
|
27
|
+
Enabled: false
|
28
|
+
Style/FrozenStringLiteralComment:
|
29
|
+
Enabled: false
|
30
|
+
RequireScriptNonce:
|
31
|
+
enabled: false
|
32
|
+
SpaceInHtmlTag:
|
33
|
+
enabled: false
|
34
|
+
StrictLocals:
|
35
|
+
enabled: true
|
data/lib/gemwork/version.rb
CHANGED
data/lib/tasks/brakeman.rake
CHANGED
@@ -5,10 +5,19 @@ task(:brakeman, :output_files) do |_task, args|
|
|
5
5
|
require "brakeman"
|
6
6
|
|
7
7
|
files = args[:output_files].split if args[:output_files]
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
8
|
+
result =
|
9
|
+
Brakeman.run(
|
10
|
+
app_path: ".",
|
11
|
+
quiet: true,
|
12
|
+
output_files: files,
|
13
|
+
print_report: false,
|
14
|
+
pager: false)
|
15
|
+
|
16
|
+
if result.warnings.empty?
|
17
|
+
puts "\e[32m0 warnings\e[0m"
|
18
|
+
else
|
19
|
+
puts "\e[31mWarnings found\e[0m"
|
20
|
+
puts result.report
|
21
|
+
exit 1
|
22
|
+
end
|
14
23
|
end
|
data/lib/tasks/rubocop.rake
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gemwork
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul DobbinSchmaltz
|
8
8
|
bindir: exe
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-02-
|
10
|
+
date: 2025-02-15 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: rake
|
@@ -202,6 +202,7 @@ files:
|
|
202
202
|
- LICENSE.txt
|
203
203
|
- README.md
|
204
204
|
- lib/.DS_Store
|
205
|
+
- lib/erb_lint/.erb_lint.yml
|
205
206
|
- lib/gemwork.rb
|
206
207
|
- lib/gemwork/.DS_Store
|
207
208
|
- lib/gemwork/test/support/much_stub-rails.rb
|
@@ -230,6 +231,7 @@ files:
|
|
230
231
|
- lib/rubocop/style-rails.yml
|
231
232
|
- lib/rubocop/style.yml
|
232
233
|
- lib/tasks/brakeman.rake
|
234
|
+
- lib/tasks/erb_lint.rake
|
233
235
|
- lib/tasks/eslint.rake
|
234
236
|
- lib/tasks/prettier.rake
|
235
237
|
- lib/tasks/reek.rake
|