sequra-style 1.19.0 → 1.20.0

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: 47e2880848be7928ef68435e320055b4d2003f4b321d172094fa77f123f5139e
4
- data.tar.gz: d8ef008a1b7ba0477c45a19d52eb965d86a994fe5c7c203c67ecc2941f2ac798
3
+ metadata.gz: 3770f72aeb14f7c4749dfc85af3445d35a43b3b753a9ae5e4730a5059346b7da
4
+ data.tar.gz: 58efdf1bb4c1170f0472027750e3ab14ca743a81bb4fa05bc18af3970f716c34
5
5
  SHA512:
6
- metadata.gz: 19d7b3760cf692ed282a02b99416f5d3e6f9fc288a8f5ecf8086e40459215f8665c27fc90f336183e42dcc37823668364a9d8503fa8a462b3afc5ad0d68885cb
7
- data.tar.gz: 17bd16a9f9499060f4ee8e986c0f7a12e32a5a1f5d28ba494b9b5ca2d6ac8e78dda03254ea83d75c8073bc7823c60a738f171dd492e76910269fd41f1f5574da
6
+ metadata.gz: 991d993cc329899e2c6f1e7729d33fe52faae04060f9e6e60439e55b4f84a9d2a2d5ee7528a939dfbe4353b3374c39d93485166a388d35a0f9132fe37c88040f
7
+ data.tar.gz: 431c3ea441b5700236cd35fc20a14fb271b79e7713576949a428bcda995dd22921a3d3678c7047e214191896d186339a583271ad2ca4289d79731a52c5871c3f
@@ -0,0 +1,57 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "bundler"
4
+ directory: "/"
5
+ # This gem is the shared rubocop config, so its gemspec ranges decide what every
6
+ # seQura Ruby repo resolves. Dependabot refreshes Gemfile.lock and never rewrites
7
+ # them: a cop bump landing everywhere at once stays a human decision.
8
+ versioning-strategy: "lockfile-only"
9
+ schedule:
10
+ interval: "weekly"
11
+ day: "monday"
12
+ time: "08:00"
13
+ timezone: "Europe/Madrid"
14
+ open-pull-requests-limit: 5
15
+ # PR titles are linted for conventional commits, and "chore" keeps release-please
16
+ # from cutting a release for a lockfile change.
17
+ commit-message:
18
+ prefix: "chore(deps)"
19
+ prefix-development: "chore(deps-dev)"
20
+ labels: ["dependencies", "ruby"]
21
+ # Applies to version updates only: security fixes are never held back.
22
+ cooldown:
23
+ default-days: 7
24
+ semver-major-days: 30
25
+ semver-minor-days: 7
26
+ semver-patch-days: 3
27
+ groups:
28
+ bundler-minor-patch:
29
+ dependency-type: "production"
30
+ patterns: ["*"]
31
+ update-types: ["minor", "patch"]
32
+ # Development dependencies never reach consumers: green CI is enough to merge.
33
+ bundler-dev-minor-patch:
34
+ dependency-type: "development"
35
+ patterns: ["*"]
36
+ update-types: ["minor", "patch"]
37
+ # Majors stay ungrouped so each keeps its own reviewable PR.
38
+
39
+ - package-ecosystem: "github-actions"
40
+ directory: "/"
41
+ schedule:
42
+ interval: "weekly"
43
+ day: "monday"
44
+ time: "08:00"
45
+ timezone: "Europe/Madrid"
46
+ open-pull-requests-limit: 3
47
+ commit-message:
48
+ prefix: "chore(deps)"
49
+ labels: ["dependencies", "github-actions"]
50
+ # github-actions supports default-days only: the semver tiers are documented as
51
+ # unsupported for it, so they would be silently ignored here.
52
+ cooldown:
53
+ default-days: 7
54
+ groups:
55
+ github-actions-minor-patch:
56
+ patterns: ["*"]
57
+ update-types: ["minor", "patch"]
@@ -15,6 +15,6 @@ jobs:
15
15
  name: Validate PR title
16
16
  runs-on: ubuntu-latest
17
17
  steps:
18
- - uses: amannn/action-semantic-pull-request@v5
18
+ - uses: amannn/action-semantic-pull-request@v6
19
19
  env:
20
20
  GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -3,18 +3,26 @@ on:
3
3
  push:
4
4
  branches:
5
5
  - 'master'
6
+ # Least privilege for the release job: contents, issues and pull-requests are what
7
+ # release-please needs to open, label and tag the release PR. The gem is pushed to
8
+ # rubygems.org with its own token, so no packages scope is needed here.
9
+ permissions:
10
+ contents: write
11
+ issues: write
12
+ pull-requests: write
6
13
  jobs:
7
14
  release:
8
15
  runs-on: ubuntu-latest
9
16
  steps:
10
- - uses: GoogleCloudPlatform/release-please-action@v3
17
+ # Release type, gem name and version file moved to release-please-config.json:
18
+ # v4 removed those inputs in favour of the manifest configuration, and unknown
19
+ # `with:` keys only warn, so stale inputs would silently stop bumping version.rb.
20
+ - uses: googleapis/release-please-action@v5
11
21
  id: release
12
22
  with:
13
- release-type: ruby
14
- package-name: sequra-style
15
- bump-minor-pre-major: true
16
- version-file: 'lib/sequra/style/version.rb'
17
- - uses: actions/checkout@v2
23
+ config-file: release-please-config.json
24
+ manifest-file: .release-please-manifest.json
25
+ - uses: actions/checkout@v7
18
26
  if: ${{ steps.release.outputs.release_created }}
19
27
  - uses: ruby/setup-ruby@v1
20
28
  with:
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "1.20.0"
3
+ }
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.20.0](https://github.com/sequra/sequra-style/compare/v1.19.0...v1.20.0) (2026-08-26)
4
+
5
+
6
+ ### Features
7
+
8
+ * [COR-2792] add Sequra/NoHelpers cop ([#91](https://github.com/sequra/sequra-style/issues/91)) ([443db77](https://github.com/sequra/sequra-style/commit/443db77b813cee105abb3d9a4ea71d54c9c221e6))
9
+
3
10
  ## [1.19.0](https://github.com/sequra/sequra-style/compare/v1.18.0...v1.19.0) (2026-07-29)
4
11
 
5
12
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sequra-style (1.19.0)
4
+ sequra-style (1.20.0)
5
5
  rubocop (~> 1.75)
6
6
  rubocop-performance (~> 1.25)
7
7
  rubocop-rails (~> 2.31)
@@ -10,7 +10,7 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activesupport (8.1.3)
13
+ activesupport (8.1.3.1)
14
14
  base64
15
15
  bigdecimal
16
16
  concurrent-ruby (~> 1.0, >= 1.3.1)
@@ -25,29 +25,30 @@ GEM
25
25
  uri (>= 0.13.1)
26
26
  ast (2.4.3)
27
27
  base64 (0.3.0)
28
- bigdecimal (4.0.1)
29
- concurrent-ruby (1.3.6)
28
+ bigdecimal (4.1.2)
29
+ concurrent-ruby (1.3.8)
30
30
  connection_pool (3.0.2)
31
31
  diff-lcs (1.6.2)
32
32
  drb (2.2.3)
33
- i18n (1.14.8)
33
+ i18n (1.15.2)
34
34
  concurrent-ruby (~> 1.0)
35
- json (2.19.8)
36
- language_server-protocol (3.17.0.5)
35
+ json (2.21.2)
36
+ language_server-protocol (3.17.0.6)
37
37
  lint_roller (1.1.0)
38
38
  logger (1.7.0)
39
- minitest (6.0.1)
39
+ minitest (6.0.6)
40
+ drb (~> 2.0)
40
41
  prism (~> 1.5)
41
- parallel (1.27.0)
42
- parser (3.3.10.1)
42
+ parallel (2.1.0)
43
+ parser (3.3.12.0)
43
44
  ast (~> 2.4.1)
44
45
  racc
45
46
  prism (1.9.0)
46
47
  racc (1.8.1)
47
- rack (3.2.6)
48
+ rack (3.2.7)
48
49
  rainbow (3.1.1)
49
50
  rake (13.0.6)
50
- regexp_parser (2.11.3)
51
+ regexp_parser (2.12.0)
51
52
  rspec (3.13.2)
52
53
  rspec-core (~> 3.13.0)
53
54
  rspec-expectations (~> 3.13.0)
@@ -61,33 +62,34 @@ GEM
61
62
  diff-lcs (>= 1.2.0, < 2.0)
62
63
  rspec-support (~> 3.13.0)
63
64
  rspec-support (3.13.7)
64
- rubocop (1.84.1)
65
+ rubocop (1.89.0)
65
66
  json (~> 2.3)
66
67
  language_server-protocol (~> 3.17.0.2)
67
68
  lint_roller (~> 1.1.0)
68
- parallel (~> 1.10)
69
+ parallel (>= 1.10)
69
70
  parser (>= 3.3.0.2)
70
71
  rainbow (>= 2.2.2, < 4.0)
71
72
  regexp_parser (>= 2.9.3, < 3.0)
72
73
  rubocop-ast (>= 1.49.0, < 2.0)
73
74
  ruby-progressbar (~> 1.7)
74
75
  unicode-display_width (>= 2.4.0, < 4.0)
75
- rubocop-ast (1.49.0)
76
+ rubocop-ast (1.50.0)
76
77
  parser (>= 3.3.7.2)
77
78
  prism (~> 1.7)
78
- rubocop-performance (1.26.1)
79
+ rubocop-performance (1.27.0)
79
80
  lint_roller (~> 1.1)
80
- rubocop (>= 1.75.0, < 2.0)
81
+ rubocop (>= 1.89.0, < 2.0)
81
82
  rubocop-ast (>= 1.47.1, < 2.0)
82
- rubocop-rails (2.34.3)
83
+ rubocop-rails (2.37.0)
83
84
  activesupport (>= 4.2.0)
84
85
  lint_roller (~> 1.1)
85
86
  rack (>= 1.1)
86
- rubocop (>= 1.75.0, < 2.0)
87
+ rubocop (>= 1.89.0, < 2.0)
87
88
  rubocop-ast (>= 1.44.0, < 2.0)
88
- rubocop-rspec (3.9.0)
89
+ rubocop-rspec (3.10.2)
89
90
  lint_roller (~> 1.1)
90
- rubocop (~> 1.81)
91
+ regexp_parser (>= 2.0)
92
+ rubocop (~> 1.86, >= 1.86.2)
91
93
  ruby-progressbar (1.13.0)
92
94
  securerandom (0.4.1)
93
95
  tzinfo (2.0.6)
data/default.yml CHANGED
@@ -845,6 +845,17 @@ Sequra/AsyncJobPattern:
845
845
  Exclude:
846
846
  - "**/application_job.rb"
847
847
 
848
+ # Forbid Rails helpers. Helpers are globally mixed into every view, so they have
849
+ # no owner, no boundary and nothing to unit test; display logic belongs to
850
+ # presenters, formatters and calculators. Path-based at any nesting depth, so pack
851
+ # helper directories are covered too.
852
+ # Ships disabled so consumer repos opt in once their own `app/helpers/` is empty
853
+ # (paired with `.rubocop_todo.yml` to grandfather the stragglers).
854
+ Sequra/NoHelpers:
855
+ Enabled: false
856
+ Include:
857
+ - "**/app/helpers/**/*.rb"
858
+
848
859
  # Forbid stubbing/spying on Sidekiq enqueue methods in specs. Stubs bypass
849
860
  # `Sidekiq.strict_args!` validation, which has caused silent production
850
861
  # failures (COR-1923). Use `have_enqueued_sidekiq_job` or
@@ -0,0 +1,53 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RuboCop
4
+ module Cop
5
+ module Sequra
6
+ # Flags any module or class defined under an `app/helpers/` directory.
7
+ #
8
+ # Rails helpers are globally mixed into every view, so they have no owner, no
9
+ # boundary and nothing to unit test. Display logic belongs to presenters (view
10
+ # context), formatters (pure data transformation) and calculators (derived values).
11
+ #
12
+ # The check is path-based, not name-based: a class named `RoutingHelper` outside
13
+ # `app/helpers/` is fine, and anything inside it is not. Any nesting depth is
14
+ # covered, so pack and nested-pack helper directories are caught too.
15
+ #
16
+ # @example
17
+ # # bad - app/helpers/foo_helper.rb, packs/my_pack/app/helpers/foo_helper.rb
18
+ # module FooHelper
19
+ # def label(order) = order.reference
20
+ # end
21
+ #
22
+ # # good - app/presenters/foo_presenter.rb
23
+ # class FooPresenter
24
+ # def label = order.reference
25
+ # end
26
+ class NoHelpers < Base
27
+ MSG = "Do not create helpers. Use presenters, formatters, or calculators instead."
28
+
29
+ HELPER_PATH = %r{(^|/)app/helpers/}
30
+
31
+ def on_module(node)
32
+ add_offense(declaration_range(node)) if helper_file?
33
+ end
34
+
35
+ def on_class(node)
36
+ add_offense(declaration_range(node)) if helper_file?
37
+ end
38
+
39
+ private
40
+
41
+ # Keeps the highlight on the declaration instead of the whole body, which editors
42
+ # would otherwise underline end to end.
43
+ def declaration_range(node)
44
+ node.loc.keyword.join(node.loc.name)
45
+ end
46
+
47
+ def helper_file?
48
+ processed_source.file_path.match?(HELPER_PATH)
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
@@ -1,5 +1,5 @@
1
1
  module Sequra
2
2
  module Style
3
- VERSION = "1.19.0"
3
+ VERSION = "1.20.0"
4
4
  end
5
5
  end
data/lib/sequra_style.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require "rubocop"
2
2
  require_relative "rubocop/cop/sequra/async_job_pattern"
3
+ require_relative "rubocop/cop/sequra/no_helpers"
3
4
  require_relative "rubocop/cop/sequra/no_sidekiq_perform_stubs"
4
5
  require_relative "rubocop/cop/sequra/prometheus_metric_labels"
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3
+ "packages": {
4
+ ".": {
5
+ "release-type": "ruby",
6
+ "package-name": "sequra-style",
7
+ "include-component-in-tag": false,
8
+ "version-file": "lib/sequra/style/version.rb"
9
+ }
10
+ }
11
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequra-style
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.0
4
+ version: 1.20.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sequra engineering
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-07-30 00:00:00.000000000 Z
11
+ date: 2026-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop
@@ -123,9 +123,11 @@ extra_rdoc_files: []
123
123
  files:
124
124
  - ".github/CODEOWNERS"
125
125
  - ".github/PULL_REQUEST_TEMPLATE.md"
126
+ - ".github/dependabot.yml"
126
127
  - ".github/workflows/pr_title_validation.yml"
127
128
  - ".github/workflows/release.yml"
128
129
  - ".gitignore"
130
+ - ".release-please-manifest.json"
129
131
  - ".rubocop.yml"
130
132
  - CHANGELOG.md
131
133
  - Gemfile
@@ -141,11 +143,13 @@ files:
141
143
  - docs/decisions/index.md
142
144
  - docs/decisions/template.md
143
145
  - lib/rubocop/cop/sequra/async_job_pattern.rb
146
+ - lib/rubocop/cop/sequra/no_helpers.rb
144
147
  - lib/rubocop/cop/sequra/no_sidekiq_perform_stubs.rb
145
148
  - lib/rubocop/cop/sequra/prometheus_metric_labels.rb
146
149
  - lib/sequra/style.rb
147
150
  - lib/sequra/style/version.rb
148
151
  - lib/sequra_style.rb
152
+ - release-please-config.json
149
153
  - sequra-style.gemspec
150
154
  homepage: https://github.com/sequra/sequra-style
151
155
  licenses: