Skip to content

Commit 87ced2d

Browse files
committed
New improvement
1 parent 18ec740 commit 87ced2d

9 files changed

Lines changed: 43 additions & 43 deletions

spml/src/main/resources/unified-generator.xsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Description: </xsl:text><xsl:value-of select="normalize-space(rule-description)"
109109
<xsl:if test="code-examples/bad-example">
110110
<xsl:text>
111111

112-
**Bad Example:**
112+
**Bad example:**
113113

114114
```</xsl:text>
115115
<xsl:if test="code-examples/bad-example/code-block/@language">

spml/src/test/resources/110-java-maven-best-practices.mdc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Description: Use the `<dependencyManagement>` section in parent POMs or import B
9494
</project>
9595
```
9696

97-
**Bad Example:**
97+
**Bad example:**
9898

9999
```xml
100100
<!-- Child POM hardcoding versions -->
@@ -143,7 +143,7 @@ my-app/
143143
└── test-data.xml
144144
```
145145

146-
**Bad Example:**
146+
**Bad example:**
147147

148148
```
149149
my-app/
@@ -200,7 +200,7 @@ Description: Use `<pluginManagement>` in a parent POM to define plugin versions
200200
</project>
201201
```
202202

203-
**Bad Example:**
203+
**Bad example:**
204204

205205
```xml
206206
<!-- Child POM -->
@@ -275,7 +275,7 @@ Description: Use Maven profiles to customize build settings for different enviro
275275

276276
```
277277

278-
**Bad Example:**
278+
**Bad example:**
279279

280280
```xml
281281
<!-- Commented out sections for different environments -->
@@ -347,7 +347,7 @@ Description: Organize your `pom.xml` sections in a consistent order (e.g., proje
347347
</project>
348348
```
349349

350-
**Bad Example:**
350+
**Bad example:**
351351

352352
```xml
353353
<!-- Haphazard order, missing properties for versions -->
@@ -398,7 +398,7 @@ Description: Prefer dependencies from Maven Central. If custom repositories are
398398
<!-- Better: Configure these in settings.xml and use a repository manager -->
399399
```
400400

401-
**Bad Example:**
401+
**Bad example:**
402402

403403
```xml
404404
<!-- No explicit repository for a non-central artifact, relying on developer's local settings or transitive ones -->
@@ -504,7 +504,7 @@ Description: Define all dependency and plugin versions in the `<properties>` sec
504504
</project>
505505
```
506506

507-
**Bad Example:**
507+
**Bad example:**
508508

509509
```xml
510510
<!-- Hardcoded versions scattered throughout the POM -->

spml/src/test/resources/121-java-object-oriented-design.mdc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class UserEmailer {
5757
}
5858
```
5959

60-
**Bad Example:**
60+
**Bad example:**
6161

6262
```java
6363
// Bad: User class with multiple responsibilities
@@ -133,7 +133,7 @@ class Car {
133133
}
134134
```
135135

136-
**Bad Example:**
136+
**Bad example:**
137137

138138
```java
139139
// Bad: Tight coupling, not programming to an interface
@@ -197,7 +197,7 @@ class BankAccount {
197197
}
198198
```
199199

200-
**Bad Example:**
200+
**Bad example:**
201201

202202
```java
203203
// Bad: Poor encapsulation - direct field access
@@ -262,7 +262,7 @@ class OrderValidator {
262262
}
263263
```
264264

265-
**Bad Example:**
265+
**Bad example:**
266266

267267
```java
268268
// Bad: God Class - doing too many things
@@ -291,4 +291,4 @@ class OrderManager {
291291

292292
// This class has too many responsibilities and reasons to change
293293
}
294-
```
294+
```

spml/src/test/resources/122-java-type-design.mdc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public class OrderManagement {
7171
}
7272
```
7373

74-
**Bad Example:**
74+
**Bad example:**
7575

7676
```java
7777
// AVOID: Flat structure with ambiguous names
@@ -133,7 +133,7 @@ class StandardShippingCalculator implements ShippingCalculator {
133133
}
134134
```
135135

136-
**Bad Example:**
136+
**Bad example:**
137137

138138
```java
139139
// AVOID: Inconsistent naming patterns
@@ -243,7 +243,7 @@ void processPayment(EmailAddress customerEmail, Money paymentAmount) {
243243
}
244244
```
245245

246-
**Bad Example:**
246+
**Bad example:**
247247

248248
```java
249249
// AVOID: Primitive obsession
@@ -321,7 +321,7 @@ Optional<Customer> customer = customerRepo.findById(1L);
321321
List<Product> products = productRepo.findAll();
322322
```
323323

324-
**Bad Example:**
324+
**Bad example:**
325325

326326
```java
327327
// AVOID: Multiple similar classes with duplicated logic
@@ -433,7 +433,7 @@ public class FinancialCalculator {
433433
}
434434
```
435435

436-
**Bad Example:**
436+
**Bad example:**
437437

438438
```java
439439
// AVOID: Using double for financial calculations - precision issues
@@ -479,4 +479,4 @@ public class InaccurateFinancialCalculator {
479479
System.out.println("Rounded 2: " + Math.round(result2 * 100.0) / 100.0);
480480
}
481481
}
482-
```
482+
```

spml/src/test/resources/123-java-general-guidelines.mdc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class Repository<T extends Entity> { // Single uppercase letter
5252
}
5353
```
5454

55-
**Bad Example:**
55+
**Bad example:**
5656

5757
```java
5858
// AVOID: Poor naming conventions
@@ -99,7 +99,7 @@ public class FormattingExample {
9999
}
100100
```
101101

102-
**Bad Example:**
102+
**Bad example:**
103103

104104
```java
105105
// AVOID: Poor formatting
@@ -153,7 +153,7 @@ public class UserService {
153153
}
154154
```
155155

156-
**Bad Example:**
156+
**Bad example:**
157157

158158
```java
159159
// AVOID: Disorganized imports
@@ -223,7 +223,7 @@ public class StringUtil {
223223
}
224224
```
225225

226-
**Bad Example:**
226+
**Bad example:**
227227

228228
```java
229229
// AVOID: Poor or missing documentation
@@ -288,7 +288,7 @@ public class SecureFileProcessor {
288288
}
289289
```
290290

291-
**Bad Example:**
291+
**Bad example:**
292292

293293
```java
294294
// AVOID: Poor error handling
@@ -315,4 +315,4 @@ public class UnsafeFileProcessor {
315315
return null;
316316
}
317317
}
318-
```
318+
```

spml/src/test/resources/124-java-secure-coding.mdc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public class SecureInputValidator {
7777
}
7878
```
7979

80-
**Bad Example:**
80+
**Bad example:**
8181

8282
```java
8383
// AVOID: No input validation
@@ -155,7 +155,7 @@ public class SecureDataAccess {
155155
}
156156
```
157157

158-
**Bad Example:**
158+
**Bad example:**
159159

160160
```java
161161
// AVOID: Vulnerable to SQL Injection
@@ -269,7 +269,7 @@ public interface AdminService extends UserService {
269269
}
270270
```
271271

272-
**Bad Example:**
272+
**Bad example:**
273273

274274
```java
275275
// AVOID: Excessive privileges and exposure
@@ -402,7 +402,7 @@ public class SecureCryptoUtils {
402402
}
403403
```
404404

405-
**Bad Example:**
405+
**Bad example:**
406406

407407
```java
408408
// AVOID: Weak cryptographic practices
@@ -567,7 +567,7 @@ public class SecureExceptionHandler {
567567
}
568568
```
569569

570-
**Bad Example:**
570+
**Bad example:**
571571

572572
```java
573573
// AVOID: Insecure exception handling
@@ -630,4 +630,4 @@ public class InsecureExceptionHandler {
630630
}
631631
}
632632
}
633-
```
633+
```

spml/src/test/resources/125-java-concurrency.mdc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public class ThreadSafeCounter {
100100
}
101101
```
102102

103-
**Bad Example:**
103+
**Bad example:**
104104

105105
```java
106106
// AVOID: Poor thread safety practices
@@ -241,7 +241,7 @@ public class ThreadPoolManager {
241241
}
242242
```
243243

244-
**Bad Example:**
244+
**Bad example:**
245245

246246
```java
247247
// AVOID: Poor thread pool management
@@ -407,7 +407,7 @@ public class EventBus {
407407
}
408408
```
409409

410-
**Bad Example:**
410+
**Bad example:**
411411

412412
```java
413413
// AVOID: Poor concurrent pattern implementation
@@ -589,7 +589,7 @@ public class AsyncService {
589589
}
590590
```
591591

592-
**Bad Example:**
592+
**Bad example:**
593593

594594
```java
595595
// AVOID: Blocking operations and poor error handling
@@ -790,7 +790,7 @@ public class VirtualThreadExample {
790790
}
791791
```
792792

793-
**Bad Example:**
793+
**Bad example:**
794794

795795
```java
796796
// AVOID: Misusing virtual threads
@@ -870,4 +870,4 @@ public class BadVirtualThreadUsage {
870870
System.out.println("Processing for user: " + userId);
871871
}
872872
}
873-
```
873+
```

spml/src/test/resources/126-java-logging.mdc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public class UserService {
9393
}
9494
```
9595

96-
**Bad Example:**
96+
**Bad example:**
9797

9898
```java
9999
// AVOID: Using System.out.println or direct logging implementation
@@ -245,7 +245,7 @@ public class OrderProcessor {
245245
}
246246
```
247247

248-
**Bad Example:**
248+
**Bad example:**
249249

250250
```java
251251
// AVOID: Misusing logging levels
@@ -465,7 +465,7 @@ public class SecureTransactionService {
465465
}
466466
```
467467

468-
**Bad Example:**
468+
**Bad example:**
469469

470470
```java
471471
// AVOID: Poor logging practices
@@ -821,7 +821,7 @@ public class SecureLoggingService {
821821
}
822822
```
823823

824-
**Bad Example:**
824+
**Bad example:**
825825

826826
```java
827827
// AVOID: Insecure logging practices
@@ -987,4 +987,4 @@ public class InsecureLoggingService {
987987
public PaymentException(String message) { super(message); }
988988
}
989989
}
990-
```
990+
```

spml/src/test/resources/131-java-unit-testing.mdc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ void should_reject_when_emailFormatIsInvalid() {
281281
}
282282
```
283283

284-
**Bad Example:**
284+
**Bad example:**
285285

286286
```java
287287
@Test

0 commit comments

Comments
 (0)