class-metrix 1.0.1 → 1.1.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 +4 -4
- data/.prettierrc.json +41 -0
- data/.qlty/.gitignore +7 -0
- data/.qlty/configs/.yamllint.yaml +8 -0
- data/.qlty/qlty.toml +108 -0
- data/.rubocop.yml +31 -25
- data/.vscode/README.md +230 -78
- data/.vscode/extensions.json +1 -9
- data/.vscode/keybindings.json +0 -26
- data/.vscode/settings.json +57 -11
- data/.vscode/tasks.json +90 -0
- data/CHANGELOG.md +31 -1
- data/README.md +63 -9
- data/Rakefile +64 -1
- data/config/brakeman.yml +37 -0
- data/docs/ARCHITECTURE.md +90 -48
- data/docs/QLTY_INTEGRATION.md +181 -0
- data/docs/RELEASE_GUIDE.md +318 -0
- data/docs/SLACK_INTEGRATION.md +227 -0
- data/examples/README.md +23 -17
- data/examples/basic_usage.rb +19 -19
- data/examples/debug_levels_demo.rb +15 -16
- data/examples/debug_mode_demo.rb +12 -13
- data/examples/inheritance_and_modules.rb +45 -45
- data/lib/class_metrix/version.rb +1 -1
- data/sig/manifest.yaml +12 -12
- metadata +52 -4
- data/.vscode/rbs.code-snippets +0 -61
- data/RELEASE_GUIDE.md +0 -158
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0106c0c9302df96ca95140d24c7b95cd1a9b5a6381336b96b6bd639e3edd3ba7
|
4
|
+
data.tar.gz: e8a1c3fe4e9a1be7253514ff9851a6af39b2aa0975444e38196e252c596f0fb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c0518a94b39fbfd118a5d3e4961602619cc91e611bbfef3a6e63b5d1c1b799f30b004710a3edc2489a31a060d8e6c8143f974b90dad1aab60971427f51c5c32f
|
7
|
+
data.tar.gz: e22b3a3db21c49321dcc986f79efa2eaabfe42f7b05dc75ff89e204a40f1f75e8079a11b0c1a48a3598f67082b8dd760823cd3662747ac8c2a980c5eeadb5f2a
|
data/.prettierrc.json
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
{
|
2
|
+
"semi": true,
|
3
|
+
"singleQuote": false,
|
4
|
+
"tabWidth": 2,
|
5
|
+
"useTabs": false,
|
6
|
+
"trailingComma": "none",
|
7
|
+
"bracketSpacing": true,
|
8
|
+
"bracketSameLine": false,
|
9
|
+
"arrowParens": "avoid",
|
10
|
+
"printWidth": 80,
|
11
|
+
"endOfLine": "lf",
|
12
|
+
"proseWrap": "preserve",
|
13
|
+
"htmlWhitespaceSensitivity": "css",
|
14
|
+
"embeddedLanguageFormatting": "auto",
|
15
|
+
"overrides": [
|
16
|
+
{
|
17
|
+
"files": "*.json",
|
18
|
+
"options": {
|
19
|
+
"printWidth": 120,
|
20
|
+
"tabWidth": 2
|
21
|
+
}
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"files": ["*.yml", "*.yaml"],
|
25
|
+
"options": {
|
26
|
+
"printWidth": 120,
|
27
|
+
"tabWidth": 2,
|
28
|
+
"singleQuote": false,
|
29
|
+
"bracketSpacing": true
|
30
|
+
}
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"files": "*.md",
|
34
|
+
"options": {
|
35
|
+
"printWidth": 80,
|
36
|
+
"proseWrap": "preserve",
|
37
|
+
"tabWidth": 2
|
38
|
+
}
|
39
|
+
}
|
40
|
+
]
|
41
|
+
}
|
data/.qlty/.gitignore
ADDED
data/.qlty/qlty.toml
ADDED
@@ -0,0 +1,108 @@
|
|
1
|
+
# This file was automatically generated by `qlty init`.
|
2
|
+
# You can modify it to suit your needs.
|
3
|
+
# We recommend you to commit this file to your repository.
|
4
|
+
#
|
5
|
+
# This configuration is used by both Qlty CLI and Qlty Cloud.
|
6
|
+
#
|
7
|
+
# Qlty CLI -- Code quality toolkit for developers
|
8
|
+
# Qlty Cloud -- Fully automated Code Health Platform
|
9
|
+
#
|
10
|
+
# Try Qlty Cloud: https://qlty.sh
|
11
|
+
#
|
12
|
+
# For a guide to configuration, visit https://qlty.sh/d/config
|
13
|
+
# Or for a full reference, visit https://qlty.sh/d/qlty-toml
|
14
|
+
config_version = "0"
|
15
|
+
|
16
|
+
exclude_patterns = [
|
17
|
+
"*_min.*",
|
18
|
+
"*-min.*",
|
19
|
+
"*.min.*",
|
20
|
+
"**/.yarn/**",
|
21
|
+
"**/*.d.ts",
|
22
|
+
"**/assets/**",
|
23
|
+
"**/bower_components/**",
|
24
|
+
"**/build/**",
|
25
|
+
"**/cache/**",
|
26
|
+
"**/config/**",
|
27
|
+
"**/db/**",
|
28
|
+
"**/deps/**",
|
29
|
+
"**/dist/**",
|
30
|
+
"**/extern/**",
|
31
|
+
"**/external/**",
|
32
|
+
"**/generated/**",
|
33
|
+
"**/Godeps/**",
|
34
|
+
"**/gradlew/**",
|
35
|
+
"**/mvnw/**",
|
36
|
+
"**/node_modules/**",
|
37
|
+
"**/protos/**",
|
38
|
+
"**/seed/**",
|
39
|
+
"**/target/**",
|
40
|
+
"**/templates/**",
|
41
|
+
"**/testdata/**",
|
42
|
+
"**/vendor/**",
|
43
|
+
# Project-specific exclusions
|
44
|
+
"**/.github/**", # GitHub configuration files
|
45
|
+
"**/examples/**", # Example code doesn't need strict formatting
|
46
|
+
"**/docs/**", # Documentation files are less strict
|
47
|
+
"**/.vscode/**", # VS Code configuration files
|
48
|
+
"**/bin/**", # Script files
|
49
|
+
# Documentation files with relaxed formatting
|
50
|
+
"README.md", # Readme can have long lines
|
51
|
+
"CHANGELOG.md", # Changelog can have duplicate headers
|
52
|
+
]
|
53
|
+
|
54
|
+
test_patterns = [
|
55
|
+
"**/test/**",
|
56
|
+
"**/spec/**",
|
57
|
+
"**/*.test.*",
|
58
|
+
"**/*.spec.*",
|
59
|
+
"**/*_test.*",
|
60
|
+
"**/*_spec.*",
|
61
|
+
"**/test_*.*",
|
62
|
+
"**/spec_*.*",
|
63
|
+
]
|
64
|
+
|
65
|
+
[smells]
|
66
|
+
mode = "comment"
|
67
|
+
|
68
|
+
[[source]]
|
69
|
+
name = "default"
|
70
|
+
default = true
|
71
|
+
|
72
|
+
|
73
|
+
[[plugin]]
|
74
|
+
name = "actionlint"
|
75
|
+
|
76
|
+
[[plugin]]
|
77
|
+
name = "checkov"
|
78
|
+
|
79
|
+
[[plugin]]
|
80
|
+
name = "markdownlint"
|
81
|
+
mode = "comment"
|
82
|
+
|
83
|
+
[[plugin]]
|
84
|
+
name = "osv-scanner"
|
85
|
+
|
86
|
+
[[plugin]]
|
87
|
+
name = "prettier"
|
88
|
+
|
89
|
+
[[plugin]]
|
90
|
+
name = "ripgrep"
|
91
|
+
mode = "comment"
|
92
|
+
|
93
|
+
[[plugin]]
|
94
|
+
name = "rubocop"
|
95
|
+
version = "1.75.8"
|
96
|
+
|
97
|
+
[[plugin]]
|
98
|
+
name = "trivy"
|
99
|
+
drivers = [
|
100
|
+
"config",
|
101
|
+
"fs-vuln",
|
102
|
+
]
|
103
|
+
|
104
|
+
[[plugin]]
|
105
|
+
name = "trufflehog"
|
106
|
+
|
107
|
+
[[plugin]]
|
108
|
+
name = "yamllint"
|
data/.rubocop.yml
CHANGED
@@ -3,11 +3,14 @@ AllCops:
|
|
3
3
|
SuggestExtensions: false
|
4
4
|
NewCops: enable
|
5
5
|
Exclude:
|
6
|
-
-
|
7
|
-
-
|
8
|
-
-
|
9
|
-
-
|
10
|
-
-
|
6
|
+
- bin/*
|
7
|
+
- config/**/*
|
8
|
+
- examples/**/*
|
9
|
+
- tmp/**/*
|
10
|
+
- vendor/**/*
|
11
|
+
- node_modules/**/*
|
12
|
+
- .ruby-lsp/**/*
|
13
|
+
- Rakefile
|
11
14
|
|
12
15
|
# String literal styles
|
13
16
|
Style/StringLiterals:
|
@@ -18,49 +21,52 @@ Style/StringLiteralsInInterpolation:
|
|
18
21
|
|
19
22
|
# Documentation requirements
|
20
23
|
Style/Documentation:
|
21
|
-
Enabled: false
|
24
|
+
Enabled: false # Many classes don't need top-level documentation
|
22
25
|
|
23
26
|
# Method and class length limits
|
24
27
|
Metrics/MethodLength:
|
25
|
-
Max: 25
|
28
|
+
Max: 25 # Increased to accommodate current codebase
|
26
29
|
|
27
30
|
Metrics/ClassLength:
|
28
|
-
Max: 250
|
31
|
+
Max: 250 # Increased to accommodate complex formatter classes
|
29
32
|
|
30
33
|
Metrics/BlockLength:
|
31
|
-
Max: 30
|
34
|
+
Max: 30 # Slightly increased from default
|
32
35
|
Exclude:
|
33
|
-
-
|
34
|
-
-
|
36
|
+
- spec/**/* # Allow long blocks in tests
|
37
|
+
- class-metrix.gemspec # Allow long blocks in gemspec
|
35
38
|
|
36
39
|
# Complexity limits
|
37
40
|
Metrics/AbcSize:
|
38
|
-
Max: 35
|
41
|
+
Max: 35 # Increased to accommodate current codebase
|
39
42
|
|
40
43
|
Metrics/CyclomaticComplexity:
|
41
|
-
Max: 15
|
44
|
+
Max: 15 # Increased to accommodate current codebase
|
42
45
|
|
43
46
|
Metrics/PerceivedComplexity:
|
44
|
-
Max: 15
|
47
|
+
Max: 15 # Increased to accommodate current codebase
|
45
48
|
|
46
49
|
# Line length
|
47
50
|
Layout/LineLength:
|
48
|
-
Max: 140
|
51
|
+
Max: 140 # Increased from default 120
|
49
52
|
|
50
53
|
# Naming conventions
|
51
54
|
Naming/AccessorMethodName:
|
52
|
-
Enabled: false
|
55
|
+
Enabled: false # Allow get_ prefixed methods
|
53
56
|
|
54
|
-
Naming/
|
55
|
-
Enabled: false
|
57
|
+
Naming/PredicatePrefix:
|
58
|
+
Enabled: false # Allow has_ prefixed methods
|
59
|
+
|
60
|
+
Naming/PredicateMethod:
|
61
|
+
Enabled: false # Allow boolean methods without ? suffix in tests
|
56
62
|
|
57
63
|
# Optional boolean parameters
|
58
64
|
Style/OptionalBooleanParameter:
|
59
|
-
Enabled: false
|
65
|
+
Enabled: false # Allow boolean default parameters
|
60
66
|
|
61
67
|
# Gemspec warning
|
62
68
|
Gemspec/RequiredRubyVersion:
|
63
|
-
Enabled: false
|
69
|
+
Enabled: false # Allow different ruby versions in gemspec vs rubocop
|
64
70
|
|
65
71
|
# Script permissions (for examples)
|
66
72
|
Lint/ScriptPermission:
|
@@ -72,17 +78,17 @@ Lint/ConstantDefinitionInBlock:
|
|
72
78
|
|
73
79
|
# String concatenation
|
74
80
|
Style/StringConcatenation:
|
75
|
-
Enabled: false
|
81
|
+
Enabled: false # Allow string concatenation in some cases
|
76
82
|
|
77
83
|
# Additional cops to disable based on project needs
|
78
84
|
Gemspec/DevelopmentDependencies:
|
79
|
-
Enabled: false
|
85
|
+
Enabled: false # Allow development dependencies in gemspec
|
80
86
|
|
81
87
|
Lint/DuplicateBranch:
|
82
|
-
Enabled: false
|
88
|
+
Enabled: false # Allow duplicate rescue branches for different error types
|
83
89
|
|
84
90
|
Style/ComparableClamp:
|
85
|
-
Enabled: false
|
91
|
+
Enabled: false # Allow traditional min/max patterns for clarity
|
86
92
|
|
87
93
|
Lint/NonAtomicFileOperation:
|
88
|
-
Enabled: false
|
94
|
+
Enabled: false # Allow traditional file existence checks in specs
|
data/.vscode/README.md
CHANGED
@@ -1,128 +1,280 @@
|
|
1
|
-
# VS Code
|
1
|
+
# VS Code Development Environment for ClassMetrix
|
2
2
|
|
3
3
|
## 🎯 Overview
|
4
4
|
|
5
|
-
This directory contains comprehensive VS Code
|
5
|
+
This directory contains a comprehensive VS Code development environment for the ClassMetrix Ruby gem, featuring modern Ruby development practices with full type safety through RBS and Steep integration.
|
6
6
|
|
7
|
-
##
|
7
|
+
## 🌟 Key Features
|
8
8
|
|
9
|
-
|
9
|
+
- **🔧 Complete Ruby LSP Integration** - Full language support with intelligent code completion
|
10
|
+
- **🔍 Real-time Type Checking** - Steep integration with live error detection
|
11
|
+
- **📝 RBS Type Annotations** - Full support for Ruby signature files
|
12
|
+
- **🚀 Auto-formatting** - RuboCop integration with format-on-save
|
13
|
+
- **⌨️ Custom Keyboard Shortcuts** - Optimized development workflow
|
14
|
+
- **🧪 Integrated Testing** - One-click RSpec test execution
|
15
|
+
- **🛠️ Smart Problem Matching** - VS Code integration for all tools
|
10
16
|
|
11
|
-
|
12
|
-
- **RBS Syntax** (`soutaro.rbs-syntax`) - RBS file syntax highlighting
|
13
|
-
- **Steep VS Code** (`soutaro.steep-vscode`) - Type checking integration
|
14
|
-
- **RBS Snippets** (`mateuszdrewniak.rbs-snippets`) - Code snippets for RBS
|
17
|
+
## 📦 Extensions Configuration
|
15
18
|
|
16
|
-
###
|
19
|
+
### Required Extensions (Auto-installed)
|
17
20
|
|
18
|
-
|
21
|
+
Our `extensions.json` automatically recommends these essential extensions:
|
22
|
+
|
23
|
+
- **Ruby LSP** (`shopify.ruby-lsp`) - Primary Ruby language server
|
24
|
+
- **Steep VS Code** (`soutaro.steep-vscode`) - Real-time type checking
|
25
|
+
- **Ruby Debugger** (`koichisasada.vscode-rdbg`) - Advanced debugging support
|
26
|
+
|
27
|
+
### Productivity Extensions
|
28
|
+
|
29
|
+
- **Prettier** (`esbenp.prettier-vscode`) - Markdown and JSON formatting
|
19
30
|
- **GitLens** (`eamodio.gitlens`) - Enhanced Git integration
|
20
|
-
- **
|
31
|
+
- **YAML Support** (`redhat.vscode-yaml`) - YAML file support
|
32
|
+
- **EditorConfig** (`editorconfig.editorconfig`) - Consistent editor settings
|
21
33
|
|
22
|
-
## ⚙️ Settings Configuration
|
34
|
+
## ⚙️ Intelligent Settings Configuration
|
23
35
|
|
24
36
|
### Ruby Language Support
|
25
37
|
|
26
|
-
|
27
|
-
|
28
|
-
|
38
|
+
Our settings provide optimal Ruby development experience:
|
39
|
+
|
40
|
+
```json
|
41
|
+
{
|
42
|
+
"ruby.format": "rubocop", // Use RuboCop for formatting
|
43
|
+
"ruby.useLanguageServer": true, // Enable Ruby LSP
|
44
|
+
"ruby.intellisense": "rubyLsp", // Intelligent code completion
|
45
|
+
"editor.formatOnSave": true, // Auto-format on save
|
46
|
+
"editor.semanticHighlighting.enabled": true // Enhanced syntax highlighting
|
47
|
+
}
|
48
|
+
```
|
49
|
+
|
50
|
+
### File-Specific Configurations
|
51
|
+
|
52
|
+
#### Ruby Files (`.rb`, `.gemspec`, `Rakefile`)
|
29
53
|
|
30
|
-
|
54
|
+
- **Formatter**: Ruby LSP with RuboCop
|
55
|
+
- **Tab Size**: 2 spaces
|
56
|
+
- **Line Length**: 140 characters
|
57
|
+
- **Auto-fix**: RuboCop issues on save
|
31
58
|
|
32
|
-
|
33
|
-
- **Diagnostics**: Enabled for immediate feedback
|
34
|
-
- **File Associations**: `.rbs` files properly recognized
|
59
|
+
#### RBS Files (`.rbs`)
|
35
60
|
|
36
|
-
|
61
|
+
- **Formatter**: RBS syntax formatter
|
62
|
+
- **Tab Size**: 2 spaces
|
63
|
+
- **Line Length**: 120 characters
|
64
|
+
- **Semantic Highlighting**: Enabled
|
37
65
|
|
38
|
-
|
39
|
-
|
66
|
+
#### Markdown Files (`.md`)
|
67
|
+
|
68
|
+
- **Formatter**: Prettier
|
69
|
+
- **Word Wrap**: Enabled
|
70
|
+
- **Tab Size**: 2 spaces
|
71
|
+
|
72
|
+
### Type Checking Integration
|
73
|
+
|
74
|
+
- **Steep**: Real-time type checking with diagnostics
|
75
|
+
- **RBS Validation**: Automatic signature file validation
|
76
|
+
- **Error Integration**: Problems panel integration
|
40
77
|
|
41
78
|
## 🛠️ Available Tasks
|
42
79
|
|
80
|
+
Access tasks via `Ctrl+Shift+P` → "Tasks: Run Task" or use keyboard shortcuts:
|
81
|
+
|
43
82
|
### Ruby Development Tasks
|
44
83
|
|
45
|
-
|
84
|
+
| Task | Description | Group |
|
85
|
+
| ----------------------------- | ----------------------------------------- | ----- |
|
86
|
+
| **Rubocop: Check** | Lint all Ruby files with problem matching | Test |
|
87
|
+
| **Rubocop: Fix** | Auto-fix all RuboCop issues | Build |
|
88
|
+
| **Rubocop: Fix Current File** | Fix only the current file | Build |
|
89
|
+
| **RSpec: Run All Tests** | Execute entire test suite | Test |
|
90
|
+
| **RSpec: Run Current File** | Run tests for current file only | Test |
|
91
|
+
| **Bundle Install** | Install gem dependencies | Build |
|
92
|
+
|
93
|
+
### Type Checking & RBS Tasks
|
46
94
|
|
47
|
-
| Task
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
95
|
+
| Task | Description | Group |
|
96
|
+
| ---------------------------- | ---------------------------------------- | ----- |
|
97
|
+
| **RBS: Validate** | Validate RBS syntax with error detection | Test |
|
98
|
+
| **RBS: Generate Prototypes** | Generate RBS from Ruby code | Build |
|
99
|
+
| **Steep: Type Check** | Run one-time type checking | Test |
|
100
|
+
| **Steep: Watch Mode** | Continuous type checking (background) | Build |
|
101
|
+
| **Steep: Watch All Targets** | Watch all configured targets | Build |
|
54
102
|
|
55
|
-
###
|
103
|
+
### Problem Matchers
|
56
104
|
|
57
|
-
|
58
|
-
| -------------------------- | --------------------------- | ---------------------- |
|
59
|
-
| `RBS: Validate` | Validate RBS syntax | `Ctrl+Shift+R, Ctrl+V` |
|
60
|
-
| `RBS: Generate Prototypes` | Generate RBS from Ruby code | - |
|
61
|
-
| `Steep: Type Check` | Run type checking | `Ctrl+Shift+R, Ctrl+S` |
|
62
|
-
| `Steep: Watch Mode` | Continuous type checking | `Ctrl+Shift+R, Ctrl+W` |
|
105
|
+
All tasks include intelligent problem matchers that integrate errors directly into VS Code's Problems panel:
|
63
106
|
|
64
|
-
|
107
|
+
- **RuboCop**: File/line/column error positioning
|
108
|
+
- **RSpec**: Test failure integration
|
109
|
+
- **Steep**: Type error reporting with severity levels
|
110
|
+
- **RBS**: Syntax validation errors
|
65
111
|
|
66
|
-
|
67
|
-
| ---------------- | ------------------------ |
|
68
|
-
| `Bundle Install` | Install gem dependencies |
|
112
|
+
## ⌨️ Custom Keyboard Shortcuts
|
69
113
|
|
70
|
-
|
114
|
+
Our workflow uses a two-key chord system starting with `Ctrl+Shift+R`:
|
71
115
|
|
72
|
-
###
|
116
|
+
### Primary Shortcuts
|
73
117
|
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
118
|
+
| Shortcut | Task | Description |
|
119
|
+
| ---------------------- | --------------------- | ------------------------------ |
|
120
|
+
| `Ctrl+Shift+R, Ctrl+V` | **RBS: Validate** | Validate type signatures |
|
121
|
+
| `Ctrl+Shift+R, Ctrl+S` | **Steep: Type Check** | Run type checking |
|
122
|
+
| `Ctrl+Shift+R, Ctrl+W` | **Steep: Watch Mode** | Start continuous type checking |
|
123
|
+
| `Ctrl+Shift+R, Ctrl+R` | **Rubocop: Fix** | Auto-fix code style issues |
|
78
124
|
|
79
125
|
### Usage Pattern
|
80
126
|
|
81
|
-
1. Press `Ctrl+Shift+R
|
82
|
-
2. Press the second key for the specific action
|
127
|
+
1. **Press `Ctrl+Shift+R`** to enter "Ruby development mode"
|
128
|
+
2. **Press the second key** for the specific action
|
129
|
+
3. **View results** in the integrated terminal or Problems panel
|
130
|
+
|
131
|
+
## 🚀 Getting Started
|
83
132
|
|
84
|
-
|
133
|
+
### 1. Automatic Extension Installation
|
85
134
|
|
86
|
-
|
135
|
+
When you open this workspace in VS Code, you'll be prompted to:
|
87
136
|
|
88
|
-
-
|
89
|
-
-
|
90
|
-
-
|
91
|
-
- **`rbsattr_reader`**: Attribute reader
|
92
|
-
- **`rbsattr_writer`**: Attribute writer
|
93
|
-
- **`rbsattr_accessor`**: Attribute accessor
|
137
|
+
- Install recommended extensions
|
138
|
+
- Enable workspace settings
|
139
|
+
- Configure the development environment
|
94
140
|
|
95
|
-
###
|
141
|
+
### 2. Verify Your Setup
|
96
142
|
|
97
|
-
|
98
|
-
2. Press `Tab` to expand
|
99
|
-
3. Use `Tab` to navigate through placeholders
|
143
|
+
#### Basic Functionality Check
|
100
144
|
|
101
|
-
|
145
|
+
1. **Open any `.rb` file** → Should show Ruby LSP features (autocompletion, hover info)
|
146
|
+
2. **Open any `.rbs` file** → Should have syntax highlighting and validation
|
147
|
+
3. **Save a Ruby file** → Should auto-format with RuboCop
|
148
|
+
|
149
|
+
#### Test Keyboard Shortcuts
|
150
|
+
|
151
|
+
1. **Press `Ctrl+Shift+R, Ctrl+S`** → Should run type checking
|
152
|
+
2. **Press `Ctrl+Shift+R, Ctrl+W`** → Should start watch mode
|
153
|
+
3. **Press `Ctrl+Shift+R, Ctrl+V`** → Should validate RBS files
|
154
|
+
|
155
|
+
### 3. Development Workflow
|
156
|
+
|
157
|
+
#### For Active Development
|
158
|
+
|
159
|
+
```bash
|
160
|
+
# Start continuous type checking
|
161
|
+
Ctrl+Shift+R, Ctrl+W
|
162
|
+
|
163
|
+
# Make your changes...
|
164
|
+
# Files auto-format on save
|
165
|
+
# See real-time type checking feedback
|
166
|
+
```
|
167
|
+
|
168
|
+
#### For Code Review
|
169
|
+
|
170
|
+
```bash
|
171
|
+
# Check all types
|
172
|
+
Ctrl+Shift+R, Ctrl+S
|
173
|
+
|
174
|
+
# Fix all style issues
|
175
|
+
Ctrl+Shift+R, Ctrl+R
|
176
|
+
|
177
|
+
# Validate RBS signatures
|
178
|
+
Ctrl+Shift+R, Ctrl+V
|
179
|
+
```
|
180
|
+
|
181
|
+
## 🔧 Advanced Configuration
|
182
|
+
|
183
|
+
### Debug Configuration
|
184
|
+
|
185
|
+
The included `launch.json` provides Ruby debugging setup:
|
186
|
+
|
187
|
+
- **Ruby Debug** - Full debugging support with breakpoints
|
188
|
+
- **RSpec Debug** - Debug individual test files
|
189
|
+
- **Integration** with `vscode-rdbg` extension
|
190
|
+
|
191
|
+
### Workspace Settings
|
192
|
+
|
193
|
+
Key workspace-specific settings:
|
194
|
+
|
195
|
+
```json
|
196
|
+
{
|
197
|
+
"files.autoSave": "onFocusChange", // Save when switching files
|
198
|
+
"files.trimTrailingWhitespace": true, // Clean trailing spaces
|
199
|
+
"files.insertFinalNewline": true, // Ensure final newline
|
200
|
+
"breadcrumbs.enabled": true, // Show code breadcrumbs
|
201
|
+
"workbench.editor.enablePreview": false // Always open new tabs
|
202
|
+
}
|
203
|
+
```
|
204
|
+
|
205
|
+
### File Associations
|
206
|
+
|
207
|
+
Automatic recognition for Ruby ecosystem files:
|
208
|
+
|
209
|
+
- `*.gemspec` → Ruby
|
210
|
+
- `Gemfile` → Ruby
|
211
|
+
- `Rakefile` → Ruby
|
212
|
+
- `Steepfile` → Ruby
|
213
|
+
- `*.rbs` → RBS
|
214
|
+
- `.rubocop.yml` → YAML
|
215
|
+
|
216
|
+
## 📊 Development Status
|
217
|
+
|
218
|
+
### Type Safety Status
|
219
|
+
|
220
|
+
✅ **RBS Coverage**: Complete type annotations for all public APIs
|
221
|
+
✅ **Steep Integration**: Real-time type checking with zero errors
|
222
|
+
✅ **Problem Matching**: All type errors appear in VS Code Problems panel
|
223
|
+
|
224
|
+
### Code Quality Status
|
225
|
+
|
226
|
+
✅ **RuboCop Integration**: Auto-formatting and linting on save
|
227
|
+
✅ **Test Integration**: One-click RSpec execution with results
|
228
|
+
✅ **Git Integration**: GitLens for enhanced version control
|
229
|
+
|
230
|
+
### Workflow Optimization
|
231
|
+
|
232
|
+
✅ **Keyboard Shortcuts**: Efficient two-key chord system
|
233
|
+
✅ **Background Tasks**: Watch mode for continuous feedback
|
234
|
+
✅ **Smart Defaults**: Optimized settings for Ruby development
|
235
|
+
|
236
|
+
## 🛠️ Troubleshooting
|
237
|
+
|
238
|
+
### Common Issues
|
239
|
+
|
240
|
+
#### Extensions Not Loading
|
241
|
+
|
242
|
+
- Ensure you've accepted the workspace extension recommendations
|
243
|
+
- Restart VS Code after installing extensions
|
244
|
+
- Check VS Code version compatibility
|
245
|
+
|
246
|
+
#### Type Checking Not Working
|
247
|
+
|
248
|
+
- Verify Steep is in your Gemfile: `gem 'steep', '~> 1.0'`
|
249
|
+
- Run `bundle install` to ensure dependencies
|
250
|
+
- Check that `Steepfile` exists in project root
|
102
251
|
|
103
|
-
|
252
|
+
#### RuboCop Not Formatting
|
104
253
|
|
105
|
-
|
254
|
+
- Ensure `.rubocop.yml` configuration exists
|
255
|
+
- Install RuboCop: `gem install rubocop`
|
256
|
+
- Check Ruby LSP is using RuboCop formatter
|
106
257
|
|
107
|
-
###
|
258
|
+
### Debug Commands
|
108
259
|
|
109
|
-
|
110
|
-
|
111
|
-
|
260
|
+
```bash
|
261
|
+
# Check Ruby LSP status
|
262
|
+
Ruby LSP: Show Output Channel
|
112
263
|
|
113
|
-
|
264
|
+
# Verify Steep configuration
|
265
|
+
bundle exec steep check --debug
|
114
266
|
|
115
|
-
|
116
|
-
|
117
|
-
|
267
|
+
# Test RuboCop configuration
|
268
|
+
bundle exec rubocop --version
|
269
|
+
```
|
118
270
|
|
119
|
-
##
|
271
|
+
## 📚 Additional Resources
|
120
272
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
273
|
+
- **[Ruby LSP Documentation](https://shopify.github.io/ruby-lsp/)**
|
274
|
+
- **[Steep Type Checker](https://github.com/soutaro/steep)**
|
275
|
+
- **[RBS Documentation](https://github.com/ruby/rbs)**
|
276
|
+
- **[RuboCop Configuration](https://docs.rubocop.org/)**
|
125
277
|
|
126
278
|
---
|
127
279
|
|
128
|
-
This VS Code setup provides a
|
280
|
+
This VS Code setup provides a modern, type-safe Ruby development environment optimized for the ClassMetrix gem development workflow.
|