| 2922 | return &agent_syntaxes[0]; |
| 2923 | } |
| 2924 | |
| 2925 | static const agent_syntax *agent_syntax_for_path(const char *path) { |
| 2926 | if (!path || !path[0]) return agent_syntax_for_lang(NULL); |
| 2927 | const char *base = strrchr(path, '/'); |
| 2928 | base = base ? base + 1 : path; |
| 2929 | if (!strcasecmp(base, "Dockerfile")) return agent_syntax_for_lang("sh"); |
| 2930 | if (!strcasecmp(base, "Makefile") || !strcasecmp(base, "makefile")) |
| 2931 | return agent_syntax_for_lang("sh"); |
| 2932 | const char *dot = strrchr(base, '.'); |
| 2933 | if (!dot || !dot[1]) return agent_syntax_for_lang(NULL); |
| 2934 | return agent_syntax_for_lang(dot + 1); |
no test coverage detected