diff --git a/README.rst b/README.rst index 41d5e4d0..f58f577c 100644 --- a/README.rst +++ b/README.rst @@ -133,6 +133,7 @@ looks something like this: (3/5) registry × has_ascl_badge × has_bintray_badge + × has_conan_badge × has_conda_badge × has_cran_badge × has_crates_badge @@ -302,6 +303,7 @@ The manual override will be reflected in the output, as follows: (3/5) registry × has_ascl_badge × has_bintray_badge + × has_conan_badge × has_conda_badge × has_cran_badge × has_crates_badge diff --git a/howfairis/mixins/registry_mixin.py b/howfairis/mixins/registry_mixin.py index 79165d76..4d901a38 100644 --- a/howfairis/mixins/registry_mixin.py +++ b/howfairis/mixins/registry_mixin.py @@ -14,6 +14,7 @@ def check_registry(self): results = [ self.has_ascl_badge(), self.has_bintray_badge(), + self.has_conan_badge(), self.has_conda_badge(), self.has_cran_badge(), self.has_crates_badge(), @@ -43,6 +44,11 @@ def has_bintray_badge(self): r"https://img\.shields\.io/bintray/.*"] return self._eval_regexes(regexes) + def has_conan_badge(self): + """ """ + regexes = [r"https://img\.shields\.io/conan/.*"] + return self._eval_regexes(regexes) + def has_conda_badge(self): """ """ regexes = [r"https://anaconda\.org/.*/.*/badges/downloads\.svg", @@ -71,7 +77,8 @@ def has_maven_badge(self): """ """ regexes = [r"https://badgen.net/maven/v/maven-central/.*", r"https://img\.shields\.io/maven-central/.*", - r"https://img\.shields\.io/maven-metadata/.*"] + r"https://img\.shields\.io/maven-metadata/.*", + r"https://maven-badges.herokuapp.com/maven-central/.*"] return self._eval_regexes(regexes) def has_npm_badge(self): diff --git a/tests/case1/github/snippets/cli-no-args.txt b/tests/case1/github/snippets/cli-no-args.txt index 25f0d2b1..efe95c7c 100644 --- a/tests/case1/github/snippets/cli-no-args.txt +++ b/tests/case1/github/snippets/cli-no-args.txt @@ -11,6 +11,7 @@ Proceeding without it -- expect the compliance to suffer. (3/5) registry × has_ascl_badge × has_bintray_badge + × has_conan_badge × has_conda_badge × has_cran_badge × has_crates_badge diff --git a/tests/case1/github/snippets/cli-with-nonexistent-path.txt b/tests/case1/github/snippets/cli-with-nonexistent-path.txt index b13a7d7a..923e6def 100644 --- a/tests/case1/github/snippets/cli-with-nonexistent-path.txt +++ b/tests/case1/github/snippets/cli-with-nonexistent-path.txt @@ -12,6 +12,7 @@ Proceeding without it -- expect the compliance to suffer. (3/5) registry × has_ascl_badge × has_bintray_badge + × has_conan_badge × has_conda_badge × has_cran_badge × has_crates_badge diff --git a/tests/case1/github/test_checker_no_args.py b/tests/case1/github/test_checker_no_args.py index 81c6f25e..d61f4e84 100644 --- a/tests/case1/github/test_checker_no_args.py +++ b/tests/case1/github/test_checker_no_args.py @@ -69,6 +69,11 @@ def test_has_codemeta_file(self, mocker): checker = get_checker() assert checker.has_codemeta_file() is False + def test_has_conan_badge(self, mocker): + with mocker: + checker = get_checker() + assert checker.has_conan_badge() is False + def test_has_conda_badge(self, mocker): with mocker: checker = get_checker() diff --git a/tests/case1/github/test_checker_with_emptyreasons_user_config.py b/tests/case1/github/test_checker_with_emptyreasons_user_config.py index a384d8a5..0f2befb4 100644 --- a/tests/case1/github/test_checker_with_emptyreasons_user_config.py +++ b/tests/case1/github/test_checker_with_emptyreasons_user_config.py @@ -82,6 +82,11 @@ def test_has_codemeta_file(self, mocker): checker = get_checker() assert checker.has_codemeta_file() is False + def test_has_conan_badge(self, mocker): + with mocker: + checker = get_checker() + assert checker.has_conan_badge() is False + def test_has_conda_badge(self, mocker): with mocker: checker = get_checker() diff --git a/tests/case1/github/test_checker_with_skipreasons_user_config.py b/tests/case1/github/test_checker_with_skipreasons_user_config.py index 8a582edd..322faf99 100644 --- a/tests/case1/github/test_checker_with_skipreasons_user_config.py +++ b/tests/case1/github/test_checker_with_skipreasons_user_config.py @@ -82,6 +82,11 @@ def test_has_codemeta_file(self, mocker): checker = get_checker() assert checker.has_codemeta_file() is False + def test_has_conan_badge(self, mocker): + with mocker: + checker = get_checker() + assert checker.has_conan_badge() is False + def test_has_conda_badge(self, mocker): with mocker: checker = get_checker() diff --git a/tests/case1/gitlab/snippets/cli-no-args.txt b/tests/case1/gitlab/snippets/cli-no-args.txt index 12d584c6..6f0d9719 100644 --- a/tests/case1/gitlab/snippets/cli-no-args.txt +++ b/tests/case1/gitlab/snippets/cli-no-args.txt @@ -11,6 +11,7 @@ Proceeding without it -- expect the compliance to suffer. (3/5) registry × has_ascl_badge × has_bintray_badge + × has_conan_badge × has_conda_badge × has_cran_badge × has_crates_badge diff --git a/tests/case1/gitlab/snippets/cli-with-nonexistent-path.txt b/tests/case1/gitlab/snippets/cli-with-nonexistent-path.txt index 5e573a7f..ab57741b 100644 --- a/tests/case1/gitlab/snippets/cli-with-nonexistent-path.txt +++ b/tests/case1/gitlab/snippets/cli-with-nonexistent-path.txt @@ -12,6 +12,7 @@ Proceeding without it -- expect the compliance to suffer. (3/5) registry × has_ascl_badge × has_bintray_badge + × has_conan_badge × has_conda_badge × has_cran_badge × has_crates_badge diff --git a/tests/case1/gitlab/test_checker_no_args.py b/tests/case1/gitlab/test_checker_no_args.py index 539014ac..e40dcf1d 100644 --- a/tests/case1/gitlab/test_checker_no_args.py +++ b/tests/case1/gitlab/test_checker_no_args.py @@ -69,6 +69,11 @@ def test_has_codemeta_file(self, mocker): checker = get_checker() assert checker.has_codemeta_file() is False + def test_has_conan_badge(self, mocker): + with mocker: + checker = get_checker() + assert checker.has_conan_badge() is False + def test_has_conda_badge(self, mocker): with mocker: checker = get_checker() diff --git a/tests/case1/gitlab/test_checker_with_emptyreasons_user_config.py b/tests/case1/gitlab/test_checker_with_emptyreasons_user_config.py index 096c25bb..666035b6 100644 --- a/tests/case1/gitlab/test_checker_with_emptyreasons_user_config.py +++ b/tests/case1/gitlab/test_checker_with_emptyreasons_user_config.py @@ -82,6 +82,11 @@ def test_has_codemeta_file(self, mocker): checker = get_checker() assert checker.has_codemeta_file() is False + def test_has_conan_badge(self, mocker): + with mocker: + checker = get_checker() + assert checker.has_conan_badge() is False + def test_has_conda_badge(self, mocker): with mocker: checker = get_checker() diff --git a/tests/case1/gitlab/test_checker_with_skipreasons_user_config.py b/tests/case1/gitlab/test_checker_with_skipreasons_user_config.py index 73ae330b..fb5f5073 100644 --- a/tests/case1/gitlab/test_checker_with_skipreasons_user_config.py +++ b/tests/case1/gitlab/test_checker_with_skipreasons_user_config.py @@ -82,6 +82,11 @@ def test_has_codemeta_file(self, mocker): checker = get_checker() assert checker.has_codemeta_file() is False + def test_has_conan_badge(self, mocker): + with mocker: + checker = get_checker() + assert checker.has_conan_badge() is False + def test_has_conda_badge(self, mocker): with mocker: checker = get_checker() diff --git a/tests/case2/github/snippets/cli-no-args.txt b/tests/case2/github/snippets/cli-no-args.txt index fe26734d..06debff2 100644 --- a/tests/case2/github/snippets/cli-no-args.txt +++ b/tests/case2/github/snippets/cli-no-args.txt @@ -7,6 +7,7 @@ url: https://github.com/fair-software/repo1 (3/5) registry ✓ has_ascl_badge ✓ has_bintray_badge + ✓ has_conan_badge ✓ has_conda_badge ✓ has_cran_badge ✓ has_crates_badge diff --git a/tests/case2/github/snippets/cli-with-nonexistent-path.txt b/tests/case2/github/snippets/cli-with-nonexistent-path.txt index b13a7d7a..923e6def 100644 --- a/tests/case2/github/snippets/cli-with-nonexistent-path.txt +++ b/tests/case2/github/snippets/cli-with-nonexistent-path.txt @@ -12,6 +12,7 @@ Proceeding without it -- expect the compliance to suffer. (3/5) registry × has_ascl_badge × has_bintray_badge + × has_conan_badge × has_conda_badge × has_cran_badge × has_crates_badge diff --git a/tests/case2/github/test_checker_no_args.py b/tests/case2/github/test_checker_no_args.py index 37ffaa97..00f7f385 100644 --- a/tests/case2/github/test_checker_no_args.py +++ b/tests/case2/github/test_checker_no_args.py @@ -69,6 +69,11 @@ def test_has_codemeta_file(self, mocker): checker = get_checker() assert checker.has_codemeta_file() is True + def test_has_conan_badge(self, mocker): + with mocker: + checker = get_checker() + assert checker.has_conan_badge() is True + def test_has_conda_badge(self, mocker): with mocker: checker = get_checker() diff --git a/tests/case2/github/test_checker_with_emptyreasons_user_config.py b/tests/case2/github/test_checker_with_emptyreasons_user_config.py index cd2b76ed..eb613cf7 100644 --- a/tests/case2/github/test_checker_with_emptyreasons_user_config.py +++ b/tests/case2/github/test_checker_with_emptyreasons_user_config.py @@ -82,6 +82,11 @@ def test_has_codemeta_file(self, mocker): checker = get_checker() assert checker.has_codemeta_file() is True + def test_has_conan_badge(self, mocker): + with mocker: + checker = get_checker() + assert checker.has_conan_badge() is True + def test_has_conda_badge(self, mocker): with mocker: checker = get_checker() diff --git a/tests/case2/github/test_checker_with_skipreasons_user_config.py b/tests/case2/github/test_checker_with_skipreasons_user_config.py index f2f6227a..ed3143ab 100644 --- a/tests/case2/github/test_checker_with_skipreasons_user_config.py +++ b/tests/case2/github/test_checker_with_skipreasons_user_config.py @@ -82,6 +82,11 @@ def test_has_codemeta_file(self, mocker): checker = get_checker() assert checker.has_codemeta_file() is True + def test_has_conan_badge(self, mocker): + with mocker: + checker = get_checker() + assert checker.has_conan_badge() is True + def test_has_conda_badge(self, mocker): with mocker: checker = get_checker() diff --git a/tests/case2/gitlab/snippets/cli-no-args.txt b/tests/case2/gitlab/snippets/cli-no-args.txt index 87435c36..873a1187 100644 --- a/tests/case2/gitlab/snippets/cli-no-args.txt +++ b/tests/case2/gitlab/snippets/cli-no-args.txt @@ -7,6 +7,7 @@ url: https://gitlab.com/fair-software/repo1 (3/5) registry ✓ has_ascl_badge ✓ has_bintray_badge + ✓ has_conan_badge ✓ has_conda_badge ✓ has_cran_badge ✓ has_crates_badge diff --git a/tests/case2/gitlab/snippets/cli-with-nonexistent-path.txt b/tests/case2/gitlab/snippets/cli-with-nonexistent-path.txt index 5e573a7f..ab57741b 100644 --- a/tests/case2/gitlab/snippets/cli-with-nonexistent-path.txt +++ b/tests/case2/gitlab/snippets/cli-with-nonexistent-path.txt @@ -12,6 +12,7 @@ Proceeding without it -- expect the compliance to suffer. (3/5) registry × has_ascl_badge × has_bintray_badge + × has_conan_badge × has_conda_badge × has_cran_badge × has_crates_badge diff --git a/tests/case2/gitlab/test_checker_no_args.py b/tests/case2/gitlab/test_checker_no_args.py index 15f51197..86d39535 100644 --- a/tests/case2/gitlab/test_checker_no_args.py +++ b/tests/case2/gitlab/test_checker_no_args.py @@ -69,6 +69,11 @@ def test_has_codemeta_file(self, mocker): checker = get_checker() assert checker.has_codemeta_file() is True + def test_has_conan_badge(self, mocker): + with mocker: + checker = get_checker() + assert checker.has_conan_badge() is True + def test_has_conda_badge(self, mocker): with mocker: checker = get_checker() diff --git a/tests/case2/repo-files/README.rst b/tests/case2/repo-files/README.rst index 17107d4c..679a3b04 100644 --- a/tests/case2/repo-files/README.rst +++ b/tests/case2/repo-files/README.rst @@ -24,3 +24,5 @@ :target: https://npmjs.org/package/cnpm 12. .. image:: https://img.shields.io/badge/fair--software.eu-%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F%20%20%E2%97%8F-green :target: https://fair-software.eu +13. .. image:: https://img.shields.io/conan/v/vir-simd + :target: https://conan.io/center/recipes/vir-simd diff --git a/tests/contracts/checker.py b/tests/contracts/checker.py index 8a01cd70..4939c2e1 100644 --- a/tests/contracts/checker.py +++ b/tests/contracts/checker.py @@ -48,6 +48,10 @@ def test_has_citationcff_file(self, mocked_context: Mocker): def test_has_codemeta_file(self, mocked_context: Mocker): pass + @abstractmethod + def test_has_conan_badge(self, mocked_context: Mocker): + pass + @abstractmethod def test_has_conda_badge(self, mocked_context: Mocker): pass