devex 0.3.5 → 0.3.6

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: 84ad9665940ea65a5cc4a61faae1f7bbd9bd2ef3a0f4285266c0b52e8e4dca59
4
- data.tar.gz: 14490de8537dffb0ff12c0885468fd20dc7e2f1f358cae4be1029514090e3ccf
3
+ metadata.gz: bc08d4252d01321b4ff62342728ebd41f7537c491dd67138a9df088957cc0ca7
4
+ data.tar.gz: ade9646e3cae9285a6d0a1963de71781cfeb07d22f8a4dd5468184090a26d033
5
5
  SHA512:
6
- metadata.gz: a8f2026afeef91196bfc941c8f7ac22ff6622e3873aeb8d6b8f349b799a4a76d98f2c87e2c0384dbc77029d2f5f15f8b1643d464457c43641e6f4487f0152f50
7
- data.tar.gz: 3d2e26b6df93ed0171ed9982e287e331588f47f81d3e25b07016f35c5e86860d6a3d5af3368d91d9c3ca8365a0ec7e3b4ffc18a32f17fb72400c1ab3309a2027
6
+ metadata.gz: 1e3e6e616f114b45a2b57d515cf2c5865a489024e3d2ee9ca1fc42120980dd338ad0ed3291e7df842854a9208c9e1856f831f2c314d61bd4445db3a43fb78012
7
+ data.tar.gz: 7a666b9aa04a22b3666c060f566dac967a9ed44e45725c87856bf1c5cdd80a5e3e739bb813e4e7be0efcbba616208712a476ca8d3858abb5d3954e33aab092e9
data/.rubocop.yml CHANGED
@@ -1,40 +1,24 @@
1
- # Archema RuboCop Configuration
1
+ # Devex RuboCop Configuration
2
2
  #
3
- # Layout/alignment settings come from tablecop.
4
- # This file contains archema-specific settings.
3
+ # Inherits from the shared rubocop-dx.yml base config.
4
+ # This file contains devex-specific overrides only.
5
5
 
6
- plugins:
7
- - rubocop-minitest
8
- - rubocop-tablecop
6
+ inherit_from: config/rubocop-dx.yml
9
7
 
10
8
  AllCops:
11
9
  TargetRubyVersion: 3.3
12
- NewCops: enable
13
- SuggestExtensions: false
14
10
  Exclude:
15
11
  - "tmp/**/*"
16
12
  - "vendor/**/*"
17
13
  - "coverage/**/*"
18
14
  - "examples/**/*"
19
- - "docs/msc/**/*" # Experimental analysis scripts, not production code
15
+ - "config/**/*" # YAML config files, not Ruby
16
+ - "docs/msc/**/*" # Experimental analysis scripts, not production code
20
17
 
21
18
  # ─────────────────────────────────────────────────────────────────────────────
22
- # Style
19
+ # Project-specific overrides
23
20
  # ─────────────────────────────────────────────────────────────────────────────
24
21
 
25
- # Allow both single and double quotes - use double by convention,
26
- # single when semantically meaningful (e.g., JSON-style string keys)
27
- Style/StringLiterals:
28
- Enabled: false
29
-
30
- # Prefer explicit bracket syntax for symbol arrays
31
- Style/SymbolArray:
32
- EnforcedStyle: brackets
33
-
34
- # Prefer %w[] for word arrays
35
- Style/WordArray:
36
- EnforcedStyle: percent
37
-
38
22
  # Require class/module documentation (except for internal modules)
39
23
  Style/Documentation:
40
24
  Enabled: true
@@ -42,190 +26,4 @@ Style/Documentation:
42
26
  - ClassMethods # Internal mixin modules don't need separate docs
43
27
  - DSL # DSL namespace modules documented at parent level
44
28
  Exclude:
45
- - "lib/archema/schema/differ.rb" # Operation classes are internal data structures
46
- - "lib/archema/shared_types.rb" # Module reopening, documented in main file
47
- - "lib/archema/stores.rb" # Module reopening, documented in main file
48
- - "test/**/*" # Test classes don't need documentation
49
-
50
- # Allow multi-line block chains when readable
51
- Style/MultilineBlockChain:
52
- Enabled: false
53
-
54
- # DANGEROUS: Autocorrect converts !!value to !value.nil? which has
55
- # different semantics for boolean values (!!false → false, !false.nil? → true)
56
- Style/DoubleNegation:
57
- Enabled: false
58
-
59
- # DANGEROUS: Changes semantics with mixed key types.
60
- # reject { |k, _| keys.include?(k) } handles symbol/string keys correctly,
61
- # but hash.except(*keys) treats :key and "key" as different.
62
- Style/HashExcept:
63
- Enabled: false
64
-
65
- # DANGEROUS: Converts `Module % [args]` to `format(Module, args)` which breaks
66
- # custom % methods (like ANSI % ["text", :style] for nested color spans).
67
- Style/FormatString:
68
- Enabled: false
69
-
70
- # ─────────────────────────────────────────────────────────────────────────────
71
- # Layout
72
- # ─────────────────────────────────────────────────────────────────────────────
73
-
74
- Layout/LineLength:
75
- Max: 140
76
-
77
- # Allow RBS inline type comments like #: Type
78
- Layout/LeadingCommentSpace:
79
- AllowRBSInlineAnnotation: true
80
-
81
- # ─────────────────────────────────────────────────────────────────────────────
82
- # Naming
83
- # ─────────────────────────────────────────────────────────────────────────────
84
-
85
- # DISABLED: Renames @data_layer_instance to @data_layer, but tests
86
- # use instance_variable_set(:@data_layer_instance, nil) to reset state.
87
- Naming/MemoizedInstanceVariableName:
88
- Enabled: false
89
-
90
- # DISABLED: Too pedantic about underscores in numbers (last_5, chain_from_11, 1_0_0)
91
- Naming/VariableNumber:
92
- Enabled: false
93
-
94
- # Allow common short parameter names
95
- Naming/MethodParameterName:
96
- AllowedNames:
97
- - a
98
- - b
99
- - c
100
- - e # exception, element, entry
101
- - i # index
102
- - j # secondary index
103
- - k # key
104
- - v # value
105
- - h # hash
106
- - n # number, count
107
- - x # coordinate, generic
108
- - y # coordinate
109
- - id # identifier
110
- - io # IO object
111
- - op # operation
112
- - db # database
113
- - fn # function
114
- - s1 # string comparison (levenshtein)
115
- - s2 # string comparison (levenshtein)
116
- - sc # sub_constraint in composition constraints
117
- - ds # dataset (Sequel)
118
- - to # destination (from:, to:)
119
- - of # element type (array of:)
120
- - _ # explicitly unused
121
-
122
- # Allow has_* prefix for methods that genuinely "have" something (not just predicates)
123
- # has_default?, has_role?, etc. are clearer than default?, role? in context
124
- Naming/PredicatePrefix:
125
- AllowedMethods:
126
- - has_default?
127
- - has_role?
128
- - has_managed_data?
129
- - has_cardinality_constraints?
130
- - has_temporal_defaults?
131
- - has_irreversible_operations?
132
- - has_one # DSL method: has_one :profile, Profile
133
- - has_many # DSL method: has_many :posts, Post
134
-
135
- # ─────────────────────────────────────────────────────────────────────────────
136
- # Lint
137
- # ─────────────────────────────────────────────────────────────────────────────
138
-
139
- Lint/UselessAssignment:
140
- Enabled: true
141
-
142
- # DISABLED: Forces combining case branches that happen to have the same result,
143
- # but often they represent distinct semantic intents. With tablecop alignment,
144
- # separate branches read as visual lookup tables which is clearer.
145
- Lint/DuplicateBranch:
146
- Enabled: false
147
-
148
- Lint/UnusedMethodArgument:
149
- AllowUnusedKeywordArguments: true
150
- IgnoreEmptyMethods: true
151
-
152
- Lint/MissingSuper:
153
- Enabled: false
154
-
155
- # DANGEROUS: Removes `require "set"` as "redundant" in Ruby 3.2+, but code
156
- # using Set.new will fail if Set isn't explicitly required.
157
- Lint/RedundantRequireStatement:
158
- Enabled: false
159
-
160
- # ─────────────────────────────────────────────────────────────────────────────
161
- # Metrics - Lenient thresholds for real-world code
162
- # ─────────────────────────────────────────────────────────────────────────────
163
-
164
- Metrics/MethodLength:
165
- Max: 40
166
- CountAsOne:
167
- - array
168
- - hash
169
- - heredoc
170
- Exclude:
171
- - "lib/chiridion/engine/inline_rbs_loader.rb"
172
-
173
- Metrics/AbcSize:
174
- Max: 50
175
- Exclude:
176
- - "lib/chiridion/engine/inline_rbs_loader.rb"
177
-
178
- Metrics/CyclomaticComplexity:
179
- Max: 20
180
-
181
- Metrics/PerceivedComplexity:
182
- Max: 15
183
- Exclude:
184
- - "lib/chiridion/engine/inline_rbs_loader.rb"
185
-
186
- Metrics/ClassLength:
187
- Max: 300
188
- CountAsOne:
189
- - array
190
- - hash
191
- - heredoc
192
-
193
- Metrics/BlockLength:
194
- Max: 40
195
- CountAsOne:
196
- - array
197
- - hash
198
- - heredoc
199
- Exclude:
200
- - "test/**/*"
201
- - "spec/**/*"
202
- - "features/**/*"
203
- - "lib/chiridion/engine/inline_rbs_loader.rb"
204
- AllowedMethods:
205
- - describe
206
- - context
207
- - define
208
- - configure
209
- - namespace
210
-
211
- Metrics/ParameterLists:
212
- Max: 15
213
-
214
- # ─────────────────────────────────────────────────────────────────────────────
215
- # Minitest
216
- # ─────────────────────────────────────────────────────────────────────────────
217
-
218
- Minitest/EmptyLineBeforeAssertionMethods:
219
- Enabled: false
220
-
221
- Minitest/MultipleAssertions:
222
- Max: 8
223
-
224
- # DANGEROUS: Converts `assert obj.foo?` to `assert_predicate obj, :foo?`
225
- # which breaks refinements since assert_predicate uses send() internally
226
- # and refinements are lexically scoped (don't work with send).
227
- Minitest/AssertPredicate:
228
- Enabled: false
229
-
230
- Minitest/RefutePredicate:
231
- Enabled: false
29
+ - "test/**/*" # Test classes don't need documentation
@@ -0,0 +1,202 @@
1
+ # rubocop-dx.yml - Devex shared RuboCop configuration
2
+ #
3
+ # Use this as a base for your project's .rubocop.yml:
4
+ #
5
+ # inherit_gem:
6
+ # devex: config/rubocop-dx.yml
7
+ #
8
+ # AllCops:
9
+ # TargetRubyVersion: 3.3 # Your project's Ruby version
10
+ #
11
+ # # Project-specific overrides below...
12
+ #
13
+ # Or let `dx lint` use this automatically when no .rubocop.yml exists.
14
+ #
15
+ # Layout/alignment conventions come from rubocop-tablecop.
16
+ # This file contains the rest of the house style.
17
+
18
+ plugins:
19
+ - rubocop-minitest
20
+ - rubocop-tablecop
21
+
22
+ AllCops:
23
+ NewCops: enable
24
+ SuggestExtensions: false
25
+ Exclude:
26
+ - "tmp/**/*"
27
+ - "vendor/**/*"
28
+ - "coverage/**/*"
29
+
30
+ # ─────────────────────────────────────────────────────────────────────────────
31
+ # Style
32
+ # ─────────────────────────────────────────────────────────────────────────────
33
+
34
+ # Allow both single and double quotes - use double by convention,
35
+ # single when semantically meaningful (e.g., JSON-style string keys)
36
+ Style/StringLiterals:
37
+ Enabled: false
38
+
39
+ # Prefer explicit bracket syntax for symbol arrays
40
+ Style/SymbolArray:
41
+ EnforcedStyle: brackets
42
+
43
+ # Prefer %w[] for word arrays
44
+ Style/WordArray:
45
+ EnforcedStyle: percent
46
+
47
+ # Allow multi-line block chains when readable
48
+ Style/MultilineBlockChain:
49
+ Enabled: false
50
+
51
+ # DANGEROUS: Autocorrect converts !!value to !value.nil? which has
52
+ # different semantics for boolean values (!!false -> false, !false.nil? -> true)
53
+ Style/DoubleNegation:
54
+ Enabled: false
55
+
56
+ # DANGEROUS: Changes semantics with mixed key types.
57
+ # reject { |k, _| keys.include?(k) } handles symbol/string keys correctly,
58
+ # but hash.except(*keys) treats :key and "key" as different.
59
+ Style/HashExcept:
60
+ Enabled: false
61
+
62
+ # DANGEROUS: Converts `Module % [args]` to `format(Module, args)` which breaks
63
+ # custom % methods (like ANSI % ["text", :style] for nested color spans).
64
+ Style/FormatString:
65
+ Enabled: false
66
+
67
+ # ─────────────────────────────────────────────────────────────────────────────
68
+ # Layout
69
+ # ─────────────────────────────────────────────────────────────────────────────
70
+
71
+ Layout/LineLength:
72
+ Max: 140
73
+
74
+ # Allow RBS inline type comments like #: Type
75
+ Layout/LeadingCommentSpace:
76
+ AllowRBSInlineAnnotation: true
77
+
78
+ # ─────────────────────────────────────────────────────────────────────────────
79
+ # Naming
80
+ # ─────────────────────────────────────────────────────────────────────────────
81
+
82
+ # DISABLED: Renames @foo_instance to @foo, but tests often use
83
+ # instance_variable_set(:@foo_instance, nil) to reset memoized state.
84
+ Naming/MemoizedInstanceVariableName:
85
+ Enabled: false
86
+
87
+ # DISABLED: Too pedantic about underscores in numbers (last_5, chain_from_11)
88
+ Naming/VariableNumber:
89
+ Enabled: false
90
+
91
+ # Allow common short parameter names
92
+ Naming/MethodParameterName:
93
+ AllowedNames:
94
+ - a
95
+ - b
96
+ - c
97
+ - e # exception, element, entry
98
+ - i # index
99
+ - j # secondary index
100
+ - k # key
101
+ - v # value
102
+ - h # hash
103
+ - n # number, count
104
+ - x # coordinate, generic
105
+ - y # coordinate
106
+ - id # identifier
107
+ - io # IO object
108
+ - op # operation
109
+ - db # database
110
+ - fn # function
111
+ - to # destination (from:, to:)
112
+ - of # element type (array of:)
113
+ - _ # explicitly unused
114
+
115
+ # ─────────────────────────────────────────────────────────────────────────────
116
+ # Lint
117
+ # ─────────────────────────────────────────────────────────────────────────────
118
+
119
+ # DISABLED: Forces combining case branches that happen to have the same result,
120
+ # but often they represent distinct semantic intents. With tablecop alignment,
121
+ # separate branches read as visual lookup tables which is clearer.
122
+ Lint/DuplicateBranch:
123
+ Enabled: false
124
+
125
+ Lint/UnusedMethodArgument:
126
+ AllowUnusedKeywordArguments: true
127
+ IgnoreEmptyMethods: true
128
+
129
+ # DISABLED: Too strict for mixins and decorators
130
+ Lint/MissingSuper:
131
+ Enabled: false
132
+
133
+ # DANGEROUS: Removes `require "set"` as "redundant" in Ruby 3.2+, but code
134
+ # using Set.new will fail if Set isn't explicitly required in some contexts.
135
+ Lint/RedundantRequireStatement:
136
+ Enabled: false
137
+
138
+ # ─────────────────────────────────────────────────────────────────────────────
139
+ # Metrics - Lenient thresholds for real-world code
140
+ # ─────────────────────────────────────────────────────────────────────────────
141
+
142
+ Metrics/MethodLength:
143
+ Max: 40
144
+ CountAsOne:
145
+ - array
146
+ - hash
147
+ - heredoc
148
+
149
+ Metrics/AbcSize:
150
+ Max: 50
151
+
152
+ Metrics/CyclomaticComplexity:
153
+ Max: 20
154
+
155
+ Metrics/PerceivedComplexity:
156
+ Max: 15
157
+
158
+ Metrics/ClassLength:
159
+ Max: 300
160
+ CountAsOne:
161
+ - array
162
+ - hash
163
+ - heredoc
164
+
165
+ Metrics/BlockLength:
166
+ Max: 40
167
+ CountAsOne:
168
+ - array
169
+ - hash
170
+ - heredoc
171
+ Exclude:
172
+ - "test/**/*"
173
+ - "spec/**/*"
174
+ - "features/**/*"
175
+ AllowedMethods:
176
+ - describe
177
+ - context
178
+ - define
179
+ - configure
180
+ - namespace
181
+
182
+ Metrics/ParameterLists:
183
+ Max: 15
184
+
185
+ # ─────────────────────────────────────────────────────────────────────────────
186
+ # Minitest
187
+ # ─────────────────────────────────────────────────────────────────────────────
188
+
189
+ Minitest/EmptyLineBeforeAssertionMethods:
190
+ Enabled: false
191
+
192
+ Minitest/MultipleAssertions:
193
+ Max: 8
194
+
195
+ # DANGEROUS: Converts `assert obj.foo?` to `assert_predicate obj, :foo?`
196
+ # which breaks refinements since assert_predicate uses send() internally
197
+ # and refinements are lexically scoped (don't work with send).
198
+ Minitest/AssertPredicate:
199
+ Enabled: false
200
+
201
+ Minitest/RefutePredicate:
202
+ Enabled: false
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Uses prj.linter - fails fast with helpful message if not found.
3
+ # Uses prj.linter if present, falls back to bundled rubocop-dx.yml config.
4
4
 
5
5
  desc "Run linter"
6
6
 
@@ -11,6 +11,14 @@ long_desc <<~DESC
11
11
  - RuboCop (.rubocop.yml)
12
12
  - StandardRB (.standard.yml)
13
13
 
14
+ If no linter config is found, uses the bundled rubocop-dx.yml conventions.
15
+ Create a .rubocop.yml to customize:
16
+
17
+ inherit_gem:
18
+ devex: config/rubocop-dx.yml
19
+
20
+ # Project-specific overrides...
21
+
14
22
  Pass additional arguments after -- to forward to the linter:
15
23
  dx lint -- --only=Style/StringLiterals
16
24
  DESC
@@ -21,17 +29,31 @@ flag :diff, "-d", "--diff", desc: "Only lint changed files (git diff)"
21
29
  remaining_args :files, desc: "Specific files or patterns to lint"
22
30
 
23
31
  def run
24
- # prj.linter fails fast if no .rubocop.yml or .standard.yml found
25
- linter_config = prj.linter
32
+ linter_config = detect_linter
26
33
 
27
- case linter_config.basename.to_s
28
- when ".standard.yml" then run_standardrb
29
- when ".rubocop.yml" then run_rubocop
34
+ case linter_config
35
+ when :bundled then run_rubocop_bundled
36
+ when :standard then run_standardrb
37
+ else run_rubocop
30
38
  end
31
39
  end
32
40
 
33
41
  def prj = @prj ||= Devex::ProjectPaths.new
34
42
 
43
+ # Detect which linter to use without failing if none found
44
+ def detect_linter
45
+ standard_yml = prj.root / ".standard.yml"
46
+ rubocop_yml = prj.root / ".rubocop.yml"
47
+
48
+ if standard_yml.exist?
49
+ :standard
50
+ elsif rubocop_yml.exist?
51
+ :rubocop
52
+ else
53
+ :bundled
54
+ end
55
+ end
56
+
35
57
  def run_rubocop
36
58
  args = ["rubocop"]
37
59
  args << "-a" if fix && !unsafe
@@ -42,6 +64,22 @@ def run_rubocop
42
64
  cmd(*args, chdir: prj.root).exit_on_failure!
43
65
  end
44
66
 
67
+ def run_rubocop_bundled
68
+ bundled_config = File.join(Devex.gem_root, "config", "rubocop-dx.yml")
69
+
70
+ warn "Using bundled rubocop-dx.yml (no .rubocop.yml found)"
71
+ warn " Create .rubocop.yml to customize conventions."
72
+ warn ""
73
+
74
+ args = ["rubocop", "--config", bundled_config.to_s]
75
+ args << "-a" if fix && !unsafe
76
+ args << "-A" if unsafe
77
+ args += changed_files if diff && files.empty?
78
+ args += files unless files.empty?
79
+
80
+ cmd(*args, chdir: prj.root).exit_on_failure!
81
+ end
82
+
45
83
  def run_standardrb
46
84
  args = ["standardrb"]
47
85
  args << "--fix" if fix || unsafe
data/lib/devex/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Devex
4
- VERSION = "0.3.5"
4
+ VERSION = "0.3.6"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joseph A Wecker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-12-29 00:00:00.000000000 Z
11
+ date: 2026-01-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Devex provides a unified `dx` command for common development tasks. Features include:
@@ -48,6 +48,7 @@ files:
48
48
  - LICENSE
49
49
  - README.md
50
50
  - Rakefile
51
+ - config/rubocop-dx.yml
51
52
  - devex-logo.jpg
52
53
  - docs/developing-tools.md
53
54
  - docs/ref/agent-mode.md