searxng/tests/unit
Filip Mikina 6b57705e50
[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>
2025-08-20 07:35:31 +02:00
..
engines [refactor] typification of SearXNG (MainResult) / result items (part 2) 2025-03-15 10:36:33 +01:00
network [refactor] typification of SearXNG (initial) / result items (part 1) 2025-01-28 07:07:08 +01:00
processors [refactor] typification of SearXNG (initial) / result items (part 1) 2025-01-28 07:07:08 +01:00
settings [feat] engines: add GitHub Code Search engine (#5074) 2025-08-20 07:35:31 +02:00
__init__.py [refactor] typification of SearXNG (initial) / result items (part 1) 2025-01-28 07:07:08 +01:00
test_answerers.py [refactor] typification of SearXNG (initial) / result items (part 1) 2025-01-28 07:07:08 +01:00
test_engine_github_code.py [feat] engines: add GitHub Code Search engine (#5074) 2025-08-20 07:35:31 +02:00
test_engine_tineye.py [refactor] typification of SearXNG (initial) / result items (part 1) 2025-01-28 07:07:08 +01:00
test_engines_init.py [refactor] typification of SearXNG (initial) / result items (part 1) 2025-01-28 07:07:08 +01:00
test_exceptions.py [refactor] typification of SearXNG (initial) / result items (part 1) 2025-01-28 07:07:08 +01:00
test_external_bangs.py [refactor] typification of SearXNG (initial) / result items (part 1) 2025-01-28 07:07:08 +01:00
test_locales.py [refactor] typification of SearXNG (initial) / result items (part 1) 2025-01-28 07:07:08 +01:00
test_plugin_calculator.py [test] calculator plugin: report the DeprecationWarning once (#5070) 2025-07-29 16:31:28 +02:00
test_plugin_hash.py [refactor] migrate plugins from "module" to class SXNGPlugin 2025-03-29 10:16:43 +01:00
test_plugin_self_info.py [mod] limiter: trusted proxies (#4911) 2025-08-09 23:03:30 +02:00
test_plugins.py [refactor] migrate plugins from "module" to class SXNGPlugin 2025-03-29 10:16:43 +01:00
test_preferences.py [refactor] typification of SearXNG (initial) / result items (part 1) 2025-01-28 07:07:08 +01:00
test_query.py [refactor] typification of SearXNG (initial) / result items (part 1) 2025-01-28 07:07:08 +01:00
test_results.py [refactor] typification of SearXNG (MainResult) / result items (part 2) 2025-03-15 10:36:33 +01:00
test_search.py [refactor] typification of SearXNG (initial) / result items (part 1) 2025-01-28 07:07:08 +01:00
test_settings_loader.py [refactor] typification of SearXNG (initial) / result items (part 1) 2025-01-28 07:07:08 +01:00
test_toml.py [refactor] typification of SearXNG (initial) / result items (part 1) 2025-01-28 07:07:08 +01:00
test_utils.py [fix] revision of utils.HTMLTextExtractor (#5125) 2025-08-18 16:30:51 +02:00
test_webadapter.py [refactor] typification of SearXNG (initial) / result items (part 1) 2025-01-28 07:07:08 +01:00
test_webapp.py [mod] remove option ui.static_use_hash (cache busting) (#5004) 2025-07-11 16:53:36 +02:00
test_webutils.py [refactor] typification of SearXNG (initial) / result items (part 1) 2025-01-28 07:07:08 +01:00