summaryrefslogtreecommitdiff
path: root/tests/unit/settings/test_github_code.yml
diff options
context:
space:
mode:
authorFilip Mikina <fm394471@students.mimuw.edu.pl>2025-08-20 07:35:31 +0200
committerGitHub <noreply@github.com>2025-08-20 07:35:31 +0200
commit6b57705e50875d9348c855700994395ce8a55b43 (patch)
treefd47dfeb6df94cc8efb92de068d9a925699ae177 /tests/unit/settings/test_github_code.yml
parent25647c20d1904840d089892bb118390f46c66984 (diff)
[feat] engines: add GitHub Code Search engine (#5074)
This patch adds GitHub Code Search [1] engine to allow querying the codebases. Template code.html is changed to allow passthrough of strip and highlighting options. Engine Searchcode is adjusted to pass filename and not rely on hardcoded extensions. GitHub search code API does not return the exact code line indices, this implementation assigns the code arbitrary numbers starting from 1 (effectively relabeling the code). The API allows for unauth calls, and the default engine settings default to that, although the calls are heavily rate limited. The 'text' lexer is the default pygments lexer when parsing fails. [1] https://docs.github.com/en/rest/search/search?apiVersion=2022-11-28#search-code Co-authored-by: Markus Heiser <markus.heiser@darmarIT.de>
Diffstat (limited to 'tests/unit/settings/test_github_code.yml')
-rw-r--r--tests/unit/settings/test_github_code.yml13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/unit/settings/test_github_code.yml b/tests/unit/settings/test_github_code.yml
new file mode 100644
index 000000000..2cf039138
--- /dev/null
+++ b/tests/unit/settings/test_github_code.yml
@@ -0,0 +1,13 @@
+# This SearXNG setup is used in unit tests
+
+use_default_settings:
+
+ engines:
+ keep_only: []
+
+engines:
+
+ - name: github code
+ engine: github_code
+ shortcut: "ghc"
+ disabled: true