gemwork 0.7.9 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b459cf2c0d2687e90166dd85a609e10e18e506cac0526dcda5d2f2a56ea9d36c
4
- data.tar.gz: 66a1ed2aed09441916679b66b02d9e39d50246a09f5a6dc5d1feae096154ca6c
3
+ metadata.gz: d2e343966a1395439c2480be144d1b021e71b3b393e2c5a37a3e042fb9d9e26a
4
+ data.tar.gz: c4394858040c87beaf9721891e99f28b46673c40ebdd77bc5640f610bf7ad33c
5
5
  SHA512:
6
- metadata.gz: 48a20df477c63e4d756083dacfc3e819f0a65e683bd2fada00ccdd674e26c4eeb1dd125bfbc46e082a2b3c8cd7520b77d913f671c0031b49296c1e1c320daf60
7
- data.tar.gz: 7051f6562676d243f9e501de09014c71ea0e5e1a261947bfc4855e1063b6623427bb8ea5af0fd8b6db8dc26b14797e794bfe6d178405b0fcb03f1732aa7b8b85
6
+ metadata.gz: 9b64fd4b8b8fd79164d315ec7ec04f7ca0b2211f860c92878c11d3e157e30c376110394a72ebddfce515c1393ebe7ab31741dfe2c7fdb428f3f13c960182c899
7
+ data.tar.gz: 767a780744a8429e0fe7682380e36dc5452205e6f2c2e1c28f9c7c9c64c2fae1f07cc58e672ab1230baa7d5062b572f807f40f20be1b610e9cb4ee247e879cef
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
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
+
3
10
  ## [0.7.9] - 2025-2-13
4
11
 
5
12
  - Add rake task for `erb_lint` for Rails apps
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 gems & their rake tasks, such as: `erb_lint`, `eslint`, `prettier`, `brakeman`, and `test:system`.
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
@@ -216,11 +216,34 @@ require "gemwork/test/support/spec_dsl"
216
216
 
217
217
  For a Rails app, additional configuration may be desired to improve linter support.
218
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
+
219
242
  #### eslint
220
243
 
221
244
  The below fixes eslint linting errors in Rails (7+, ...) projects.
222
245
 
223
- ```json
246
+ ```javascript
224
247
  // .eslintrc.json
225
248
 
226
249
  {
@@ -249,7 +272,7 @@ General config recommendations for prettier:
249
272
  vendor
250
273
  ```
251
274
 
252
- ```json
275
+ ```javascript
253
276
  // .prettierrc.json
254
277
 
255
278
  {
@@ -288,6 +311,7 @@ For Rails projects, you may want to manually install additional gems as well:
288
311
 
289
312
  - [rubocop-rails](https://github.com/rubocop/rubocop-rails) -- A RuboCop extension focused on enforcing Rails best practices and coding conventions.
290
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
291
315
 
292
316
  ## Development
293
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Gemwork
4
- VERSION = "0.7.9"
4
+ VERSION = "0.7.11"
5
5
  end
@@ -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
- Brakeman.run(
9
- app_path: ".",
10
- quiet: true,
11
- output_files: files,
12
- print_report: true,
13
- pager: false)
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
@@ -3,5 +3,5 @@
3
3
  require "rubocop/rake_task"
4
4
 
5
5
  RuboCop::RakeTask.new do |t|
6
- t.fail_on_error = false
6
+ t.fail_on_error = true
7
7
  end
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.9
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-14 00:00:00.000000000 Z
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