You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,9 +75,14 @@ Javadoc conventions
75
75
- Omit javadoc for simple getters/setters (e.g., `getArch()`, `setArch(String)`); they are self-explanatory.
76
76
- Omit obvious field comments that just repeat the field name (e.g., `/** The name. */ private String name;`).
77
77
- Omit obvious constant comments (e.g., `/** The constant FOO. */ public static final String FOO = "foo";`).
78
-
- Type parameter descriptions should be meaningful (e.g., `@param <T> the element type` not `@param <T> the type parameter`).
78
+
- Type parameter descriptions should use consistent format: "the type of..." (e.g., `@param <T> the type of elements` not `@param <T> the element type`).
79
79
- Do not generate javadoc for implementation classes (only interfaces and public API classes).
80
80
- For `@see` tags, avoid duplicate references (e.g., use `@see Math#sin(double)` not `@see Math#sin(double) Math#sin(double)`).
81
+
- For functional interfaces:
82
+
- Consumer descriptions must include "and returns no result" (e.g., "Represents an operation that accepts an int and an object argument, and returns no result.").
83
+
- Use type-specific @param descriptions (e.g., "the int argument", "the object argument") instead of generic "the first argument".
84
+
- Function @return should use "the function result" for consistency.
85
+
- Predicate @return should use "true if the arguments match the predicate".
Copy file name to clipboardExpand all lines: .github/skills/generate-javadoc.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,14 @@ When the user asks to:
29
29
2.**No trailing periods** - in `@param` and `@return` descriptions (e.g., `@param value the value` not `@param value the value.`)
30
30
3.**No duplicate @see references** - use `@see Math#sin(double)` not `@see Math#sin(double) Math#sin(double)`
31
31
4.**Lowercase @param/@return descriptions** - start with lowercase (e.g., `@param value the value` not `@param value The value`)
32
+
5.**Consistent type parameter format** - use "the type of..." pattern (e.g., `@param <T> the type of elements` not `@param <T> the element type`)
33
+
6.**Descriptive @param names** - for functional interfaces, use type-specific descriptions (e.g., "the int argument", "the object argument") instead of generic "the first argument"
34
+
35
+
### Functional Interface Conventions
36
+
1.**Consumer descriptions** - always include "and returns no result" (e.g., "Represents an operation that accepts an int and an object argument, and returns no result.")
37
+
2.**Function @return** - use "the function result" for consistency
38
+
3.**Predicate @return** - use "true if the arguments match the predicate" or "true if the arguments match the predicate, false otherwise"
39
+
4.**Supplier @return** - describe what is supplied (e.g., "the char value" not just "a result")
32
40
33
41
### Javadoc Standards
34
42
Each documented element must include:
@@ -91,6 +99,29 @@ public interface Array<E> extends Iterable<E> {
91
99
}
92
100
```
93
101
102
+
### Functional Interface Example
103
+
104
+
```java
105
+
/**
106
+
* Represents an operation that accepts an int and an object argument, and returns no result.
0 commit comments