Commit c7f90b7
authored
Handler shape validation guidance (#105)
* Improve handler shape validation guidance
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
* Address PR review: improve handler validation guards and guidance consistency
- Gate return-check on has_handler_function && no signature issue to
avoid misleading 'MUST return' errors on invalid handler shapes
- Expand check_handler_has_return skip logic to also skip arrow function
bodies (=> { ... }) and generator declarations (function*)
- Fix conflicting guidance in register_handler tool description: use
function handler(...) instead of function handler(event) in REQUIRED line
- Add zero-parameter form function handler() to system-message signature list
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
* fix: address PR review feedback on handler validation
- Skip misnamed-handler check when valid function handler already exists,
preventing false positives on nested helpers (e.g. function process())
- Fix inconsistent help text: handler(...) instead of handler(event) to
match the zero-parameter guidance
- Also skip function( and function*( expression forms in return check
so anonymous function expression returns are not counted as handler returns
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
---------
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>1 parent 98c1e5d commit c7f90b7
2 files changed
Lines changed: 17 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2038 | 2038 | | |
2039 | 2039 | | |
2040 | 2040 | | |
2041 | | - | |
2042 | | - | |
2043 | | - | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
2044 | 2045 | | |
2045 | 2046 | | |
2046 | 2047 | | |
| |||
2898 | 2899 | | |
2899 | 2900 | | |
2900 | 2901 | | |
2901 | | - | |
| 2902 | + | |
2902 | 2903 | | |
2903 | 2904 | | |
2904 | 2905 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1003 | 1003 | | |
1004 | 1004 | | |
1005 | 1005 | | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
1006 | 1009 | | |
| 1010 | + | |
| 1011 | + | |
1007 | 1012 | | |
1008 | 1013 | | |
1009 | 1014 | | |
| |||
1052 | 1057 | | |
1053 | 1058 | | |
1054 | 1059 | | |
1055 | | - | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
1056 | 1063 | | |
1057 | 1064 | | |
1058 | 1065 | | |
| |||
1101 | 1108 | | |
1102 | 1109 | | |
1103 | 1110 | | |
1104 | | - | |
| 1111 | + | |
| 1112 | + | |
1105 | 1113 | | |
| 1114 | + | |
| 1115 | + | |
1106 | 1116 | | |
1107 | 1117 | | |
1108 | 1118 | | |
| |||
0 commit comments