pumuki-ast-hooks 5.5.54 → 5.5.56

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pumuki-ast-hooks",
3
- "version": "5.5.54",
3
+ "version": "5.5.56",
4
4
  "description": "Enterprise-grade AST Intelligence System with multi-platform support (iOS, Android, Backend, Frontend) and Feature-First + DDD + Clean Architecture enforcement. Includes dynamic violations API for intelligent querying.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -145,27 +145,30 @@ function runCommonIntelligence(project, findings) {
145
145
  }
146
146
  });
147
147
 
148
- sf.getDescendantsOfKind(SyntaxKind.CatchClause).forEach((clause) => {
149
- const block = typeof clause.getBlock === 'function' ? clause.getBlock() : null;
150
- const statements = block && typeof block.getStatements === 'function' ? block.getStatements() : [];
151
-
152
- if ((statements || []).length === 0) {
153
- const blockText = block ? block.getText() : '';
154
- const hasTestAssertions = /XCTFail|XCTAssert|guard\s+case|expect\(|assert/i.test(blockText);
155
- const hasErrorHandling = /throw|console\.|logger\.|log\(|print\(/i.test(blockText);
156
-
157
- if (!hasTestAssertions && !hasErrorHandling) {
158
- pushFinding(
159
- 'common.error.empty_catch',
160
- 'critical',
161
- sf,
162
- clause,
163
- 'Empty catch block detected - always handle errors (log, rethrow, wrap, or return Result)',
164
- findings
165
- );
148
+ // Skip Swift files - they should only be analyzed by iOS-specific detectors
149
+ if (!/\.swift$/i.test(filePath)) {
150
+ sf.getDescendantsOfKind(SyntaxKind.CatchClause).forEach((clause) => {
151
+ const block = typeof clause.getBlock === 'function' ? clause.getBlock() : null;
152
+ const statements = block && typeof block.getStatements === 'function' ? block.getStatements() : [];
153
+
154
+ if ((statements || []).length === 0) {
155
+ const blockText = block ? block.getText() : '';
156
+ const hasTestAssertions = /XCTFail|XCTAssert|guard\s+case|expect\(|assert/i.test(blockText);
157
+ const hasErrorHandling = /throw|console\.|logger\.|log\(|print\(/i.test(blockText);
158
+
159
+ if (!hasTestAssertions && !hasErrorHandling) {
160
+ pushFinding(
161
+ 'common.error.empty_catch',
162
+ 'critical',
163
+ sf,
164
+ clause,
165
+ 'Empty catch block detected - always handle errors (log, rethrow, wrap, or return Result)',
166
+ findings
167
+ );
168
+ }
166
169
  }
167
- }
168
- });
170
+ });
171
+ }
169
172
 
170
173
  sf.getDescendantsOfKind(SyntaxKind.AnyKeyword).forEach((node) => {
171
174
 
@@ -658,6 +658,17 @@ function checkDependencyInjectionAST(analyzer, properties, filePath, className,
658
658
  continue;
659
659
  }
660
660
 
661
+ // Skip generic type parameters (e.g., "Client" in LoginUseCaseImpl<Client: APIClientProtocol>)
662
+ // These are not concrete dependencies - they are constrained by protocols
663
+ const propName = prop['key.name'] || '';
664
+ const isGenericTypeParameter = typename.length === 1 ||
665
+ (typename.match(/^[A-Z][a-z]*$/) && !typename.includes('Impl') &&
666
+ (className.includes('<') || propName === 'apiClient' || propName === 'client'));
667
+
668
+ if (isGenericTypeParameter) {
669
+ continue;
670
+ }
671
+
661
672
  const isConcreteService = /Service$|Repository$|UseCase$|Client$/.test(typename) && !typename.includes('Protocol') && !typename.includes('any ') && !typename.includes('some ');
662
673
 
663
674
  if (isConcreteService) {