From dc29f1d826305c39d200bcea7556cc31c71bf23f Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 26 Apr 2021 20:18:20 +0200 Subject: [PATCH 1/2] [pylint] tag PYLINT_FILES by comment `# lint: pylint` These py files are linted by `test.pylint`, all other files are linted by `test.pep8`. Signed-off-by: Markus Heiser --- searx/engines/apkmirror.py | 1 + searx/engines/artic.py | 1 + searx/engines/core.py | 1 + searx/engines/deviantart.py | 1 + searx/engines/digg.py | 1 + searx/engines/gigablast.py | 1 + searx/engines/google.py | 1 + searx/engines/google_images.py | 1 + searx/engines/google_news.py | 1 + searx/engines/google_scholar.py | 1 + searx/engines/google_videos.py | 1 + searx/engines/mediathekviewweb.py | 1 + searx/engines/meilisearch.py | 1 + searx/engines/solidtorrents.py | 1 + searx/engines/solr.py | 1 + searx/engines/springer.py | 1 + searx/engines/yahoo_news.py | 1 + searx/metrics/__init__.py | 1 + searx/preferences.py | 1 + searx/testing.py | 1 + searx_extra/update/update_external_bangs.py | 1 + 21 files changed, 21 insertions(+) diff --git a/searx/engines/apkmirror.py b/searx/engines/apkmirror.py index 05a635883..855d19739 100644 --- a/searx/engines/apkmirror.py +++ b/searx/engines/apkmirror.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """APKMirror """ diff --git a/searx/engines/artic.py b/searx/engines/artic.py index f8e2dced0..44af4ebd5 100644 --- a/searx/engines/artic.py +++ b/searx/engines/artic.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """The Art Institute of Chicago Explore thousands of artworks from The Art Institute of Chicago. diff --git a/searx/engines/core.py b/searx/engines/core.py index 3a1147f35..0d9724695 100644 --- a/searx/engines/core.py +++ b/searx/engines/core.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """CORE (science) """ diff --git a/searx/engines/deviantart.py b/searx/engines/deviantart.py index 7840495e1..21d56831c 100644 --- a/searx/engines/deviantart.py +++ b/searx/engines/deviantart.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """ Deviantart (Images) """ diff --git a/searx/engines/digg.py b/searx/engines/digg.py index defcacd20..5c6fb3875 100644 --- a/searx/engines/digg.py +++ b/searx/engines/digg.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """ Digg (News, Social media) """ diff --git a/searx/engines/gigablast.py b/searx/engines/gigablast.py index bbd9e20d2..d1c2639af 100644 --- a/searx/engines/gigablast.py +++ b/searx/engines/gigablast.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """ Gigablast (Web) """ diff --git a/searx/engines/google.py b/searx/engines/google.py index a4aee5c20..92c9e1399 100644 --- a/searx/engines/google.py +++ b/searx/engines/google.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """Google (Web) For detailed description of the *REST-full* API see: `Query Parameter diff --git a/searx/engines/google_images.py b/searx/engines/google_images.py index 01bdbeef2..919c99c63 100644 --- a/searx/engines/google_images.py +++ b/searx/engines/google_images.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """Google (Images) For detailed description of the *REST-full* API see: `Query Parameter diff --git a/searx/engines/google_news.py b/searx/engines/google_news.py index 27eee8144..355155de8 100644 --- a/searx/engines/google_news.py +++ b/searx/engines/google_news.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """Google (News) For detailed description of the *REST-full* API see: `Query Parameter diff --git a/searx/engines/google_scholar.py b/searx/engines/google_scholar.py index 86bb01056..a0ca70e53 100644 --- a/searx/engines/google_scholar.py +++ b/searx/engines/google_scholar.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """Google (Scholar) For detailed description of the *REST-full* API see: `Query Parameter diff --git a/searx/engines/google_videos.py b/searx/engines/google_videos.py index c80150b0e..3e3f5d6f1 100644 --- a/searx/engines/google_videos.py +++ b/searx/engines/google_videos.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """Google (Video) For detailed description of the *REST-full* API see: `Query Parameter diff --git a/searx/engines/mediathekviewweb.py b/searx/engines/mediathekviewweb.py index fa442c937..80104ae73 100644 --- a/searx/engines/mediathekviewweb.py +++ b/searx/engines/mediathekviewweb.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """MediathekViewWeb (API) """ diff --git a/searx/engines/meilisearch.py b/searx/engines/meilisearch.py index 4e0ff15f3..86cd7512c 100644 --- a/searx/engines/meilisearch.py +++ b/searx/engines/meilisearch.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """ Meilisearch """ diff --git a/searx/engines/solidtorrents.py b/searx/engines/solidtorrents.py index 050149187..b228a8c8c 100644 --- a/searx/engines/solidtorrents.py +++ b/searx/engines/solidtorrents.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """Solid Torrents """ diff --git a/searx/engines/solr.py b/searx/engines/solr.py index 0bfcbab36..e38a103a9 100644 --- a/searx/engines/solr.py +++ b/searx/engines/solr.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """ Solr """ diff --git a/searx/engines/springer.py b/searx/engines/springer.py index a9c32d8a9..77a82016b 100644 --- a/searx/engines/springer.py +++ b/searx/engines/springer.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """Springer Nature (science) """ diff --git a/searx/engines/yahoo_news.py b/searx/engines/yahoo_news.py index 49b3d1bf8..98d8bc9f1 100644 --- a/searx/engines/yahoo_news.py +++ b/searx/engines/yahoo_news.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """Yahoo (News) Yahoo News is "English only" and do not offer localized nor language queries. diff --git a/searx/metrics/__init__.py b/searx/metrics/__init__.py index 6ed578116..c2dcfaae4 100644 --- a/searx/metrics/__init__.py +++ b/searx/metrics/__init__.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint # pylint: disable=missing-module-docstring, missing-function-docstring import typing diff --git a/searx/preferences.py b/searx/preferences.py index 1c4aab33e..b0106b195 100644 --- a/searx/preferences.py +++ b/searx/preferences.py @@ -1,4 +1,5 @@ # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """Searx preferences implementation. """ diff --git a/searx/testing.py b/searx/testing.py index 51ca92bd0..3ee86372d 100644 --- a/searx/testing.py +++ b/searx/testing.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- # SPDX-License-Identifier: AGPL-3.0-or-later +# lint: pylint """Shared testing code.""" # pylint: disable=missing-function-docstring diff --git a/searx_extra/update/update_external_bangs.py b/searx_extra/update/update_external_bangs.py index e401e460a..c366fe76b 100755 --- a/searx_extra/update/update_external_bangs.py +++ b/searx_extra/update/update_external_bangs.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# lint: pylint """ Update searx/data/external_bangs.json using the duckduckgo bangs. From a92a4cb443e9bce0b06d938b28d51b44232de0f0 Mon Sep 17 00:00:00 2001 From: Markus Heiser Date: Mon, 26 Apr 2021 20:52:52 +0200 Subject: [PATCH 2/2] [pylint] get PYLINT_FILES from tag '# lint: pylint' These py files are linted by test.pylint(), all other files are linted by test.pep8() close: https://github.com/searxng/searxng/issues/21 Signed-off-by: Markus Heiser --- manage | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/manage b/manage index 9c322adb4..f42075b28 100755 --- a/manage +++ b/manage @@ -17,31 +17,17 @@ NPM_PACKAGES="less@2.7 less-plugin-clean-css grunt-cli" GECKODRIVER_VERSION="v0.28.0" # SPHINXOPTS= -# These py files are linted by test.pylint(), all other files are linted by -# test.pep8() -PYLINT_FILES=( - searx/preferences.py - searx/testing.py - searx/engines/gigablast.py - searx/engines/deviantart.py - searx/engines/digg.py - searx/engines/google.py - searx/engines/google_news.py - searx/engines/google_videos.py - searx/engines/google_images.py - searx/engines/mediathekviewweb.py - searx/engines/meilisearch.py - searx/engines/solidtorrents.py - searx/engines/solr.py - searx/engines/springer.py - searx/engines/google_scholar.py - searx/engines/yahoo_news.py - searx/engines/apkmirror.py - searx/engines/artic.py - searx/engines/core.py - searx_extra/update/update_external_bangs.py - searx/metrics/__init__.py -) +pylint.FILES() { + + # List files tagged by comment: + # + # # lint: pylint + # + # These py files are linted by test.pylint(), all other files are linted by + # test.pep8() + + grep -l -r --include \*.py '^#[[:blank:]]*lint:[[:blank:]]*pylint' searx searx_extra tests +} PYLINT_SEARX_DISABLE_OPTION="\ I,C,R,\ @@ -473,6 +459,11 @@ themes.simple() { dump_return $? } +PYLINT_FILES=() +while IFS= read -r line; do + PYLINT_FILES+=("$line") +done <<< $(pylint.FILES) + # shellcheck disable=SC2119 main() {