File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020| PHP | ` .php ` | ` php -l {file} ` | ` php-cs-fixer fix ` | composer require --dev php-cs-fixer |
2121| Ruby | ` .rb ` | ` rubocop ` | ` rubocop -A ` | gem install rubocop |
2222| Scala | ` .scala ` ` .sc ` | ` scalafmt --check . ` | ` scalafmt ` | coursier install scalafmt |
23- | Shell | ` .sh ` ` .bash ` | ` shellcheck --severity=warning {file} ` | ` shfmt -w . ` | brew install shellcheck shfmt |
23+ | Shell | ` .sh ` ` .bash ` ` .zsh ` | ` shellcheck --severity=warning {file} ` | ` shfmt -w . ` | brew install shellcheck shfmt |
2424| Dockerfile | (文件名匹配) | ` hadolint {file} ` | ` hadolint ` | brew install hadolint |
2525| YAML | ` .yml ` ` .yaml ` | ` yamllint . ` | ` yamllint . ` | pip install yamllint |
2626| Elixir | ` .ex ` ` .exs ` | ` mix credo --strict ` | ` mix format ` | 项目需配置 credo 依赖 |
Original file line number Diff line number Diff line change @@ -89,7 +89,17 @@ def is_trigger(user_text: str) -> bool:
8989 # 问句抑制按**句子粒度**:`这个方案 OK 吗?帮我提交` 问句与祈使混排时,
9090 # 整条文本级的问号判断会把祈使句一起静默(软门缺失,硬门兜底,但漏提醒
9191 # 不符合"软门多提醒不算错"的既定原则)。
92- sentences = [seg for seg in _re .split (r"[。!!??\n\r]+" , user_text ) if seg .strip ()]
92+ # 切分时用捕获组保留定界符并附回句尾——"Should I commit this?" 的问号
93+ # 在句尾,若把定界符当纯分隔符吃掉,句内标记消失会误触发(CI 实测)。
94+ parts = _re .split (r"([。!!??\n\r]+)" , user_text )
95+ sentences = []
96+ for i in range (0 , len (parts ) - 1 , 2 ):
97+ seg = (parts [i ] + parts [i + 1 ]).strip ()
98+ if seg :
99+ sentences .append (seg )
100+ tail = parts [- 1 ].strip () if len (parts ) % 2 == 1 else ""
101+ if tail :
102+ sentences .append (tail )
93103 trigger_sentences = [seg for seg in sentences if _TRIGGER_RE .search (seg )]
94104 if not trigger_sentences :
95105 return False
Original file line number Diff line number Diff line change 369369 "name" : " Shell" ,
370370 "extensions" : [
371371 " .sh" ,
372- " .bash"
372+ " .bash" ,
373+ " .zsh"
373374 ],
374375 "markers" : [],
375376 "status" : " stable" ,
You can’t perform that action at this time.
0 commit comments