File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -822,6 +822,14 @@ class AISlopDetector {
822822 }
823823 }
824824
825+ // Skip comment-line-only patterns that only make sense in actual code comments
826+ if ( pattern . id === 'overconfident_comment' ) {
827+ const trimmed = line . trim ( ) ;
828+ if ( trimmed . startsWith ( '//' ) || trimmed . startsWith ( '*' ) || trimmed . startsWith ( '/*' ) ) {
829+ continue ;
830+ }
831+ }
832+
825833 // In quiet mode, skip test and mock files for all patterns except production console logs
826834 if ( quiet && pattern . id !== 'production_console_log' ) {
827835 const isTestFile = filePath . includes ( '__tests__' ) ||
@@ -1120,7 +1128,7 @@ class AISlopDetector {
11201128 * Get the current configuration
11211129 */
11221130 getConfig ( ) : KarpeSlopConfig {
1123- return this . config ;
1131+ return { ... this . config } ;
11241132 }
11251133
11261134 /**
Original file line number Diff line number Diff line change @@ -691,6 +691,14 @@ class AISlopDetector {
691691 }
692692 }
693693
694+ // Skip comment-line-only patterns that only make sense in actual code comments
695+ if ( pattern . id === 'overconfident_comment' ) {
696+ const trimmed = line . trim ( ) ;
697+ if ( trimmed . startsWith ( '//' ) || trimmed . startsWith ( '*' ) || trimmed . startsWith ( '/*' ) ) {
698+ continue ;
699+ }
700+ }
701+
694702 // In quiet mode, skip test and mock files for all patterns except production console logs
695703 if ( quiet && pattern . id !== 'production_console_log' ) {
696704 const isTestFile = filePath . includes ( '__tests__' ) || filePath . includes ( '.test.' ) || filePath . includes ( '.spec.' ) || filePath . includes ( '__mocks__' ) || filePath . includes ( 'test-' ) ;
@@ -955,7 +963,9 @@ class AISlopDetector {
955963 * Get the current configuration
956964 */
957965 getConfig ( ) {
958- return this . config ;
966+ return {
967+ ...this . config
968+ } ;
959969 }
960970
961971 /**
You can’t perform that action at this time.
0 commit comments