diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 240759f..093f071 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: version: "latest" - name: Install Python dependencies - run: pip install black flake8 pylint + run: pip install black flake8 - name: Run linters uses: wearerequired/lint-action@v2 @@ -31,4 +31,4 @@ jobs: - name: Analysing the code with pylint run: | - uv run pylint $(git ls-files '*.py') + uv run pylint --output-format=text ./**/*.py diff --git a/README.md b/README.md index d63c4c1..97633d3 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # Visualize the HadCRUT5 temperature datasets +![Release Status](https://img.shields.io/badge/status-stable-brightgreen.svg) +![Pylint](images/pylint.svg) +[![License](https://img.shields.io/badge/License-GPL--3.0-blue.svg)](https://spdx.org/licenses/GPL-3.0-only.html) +[![GitHub stars](https://img.shields.io/github/stars/madrisan/HadCRUT5.svg?style=social)](https://github.com/madrisan/HadCRUT5/stargazers) + > HadCRUT5 is a gridded dataset of global historical surface temperature anomalies relative to a 1961-1990 reference period. > Data are available for each month from January 1850 onwards, on a 5 degree grid and as global and regional average time series. > The dataset is a collaborative product of the Met Office Hadley Centre and the Climatic Research Unit at the University of East Anglia. diff --git a/images/pylint.svg b/images/pylint.svg new file mode 100644 index 0000000..0ae6fc8 --- /dev/null +++ b/images/pylint.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + pylint + pylint + + + 10.0 + 10.0 + + diff --git a/pylint.sh b/pylint.sh new file mode 100755 index 0000000..84fa46d --- /dev/null +++ b/pylint.sh @@ -0,0 +1,16 @@ +uv run pylint \ + --verbose \ + --output-format=text ./**/*.py \ +| tee pylint-log.txt + +score="$( + sed -n "/^Your code has been rated at/{s,.* at \([0-9\.]*\)\/.*,\1,p}" \ + pylint-log.txt)" + +uv run anybadge \ + --file="images/pylint.svg" \ + --label "pylint" \ + --overwrite \ + --value "$score" + +rm -f pylint-log.txt diff --git a/pyproject.toml b/pyproject.toml index 631971f..50169d8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,7 @@ dependencies = [ [dependency-groups] dev = [ + "anybadge>=1.14.0", "black>=24.10.0", "mypy>=1.14.0", "pylint>=3.3.2", diff --git a/uv.lock b/uv.lock index 3c00b54..a9e9eb8 100644 --- a/uv.lock +++ b/uv.lock @@ -1,6 +1,18 @@ version = 1 requires-python = ">=3.12" +[[package]] +name = "anybadge" +version = "1.14.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "packaging" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a3/f2/9f55245d6f456b661b38650767410f3b51d66a8530f0e0a43909bd475165/anybadge-1.14.0.tar.gz", hash = "sha256:47f06e0a6320d3e5eac55c712dc0bab71b9ed85353c591d448653c5a0740783f", size = 29606 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f7/44/71df611ee7e19c852caa829bac653662dafec909dbe3e1b99b5ad419cefc/anybadge-1.14.0-py3-none-any.whl", hash = "sha256:8711a7f7f45317c62a460f14084f005ba665cbebdf2a94e7df53bc3ab35df4c9", size = 27258 }, +] + [[package]] name = "astroid" version = "3.3.6" @@ -485,6 +497,7 @@ dependencies = [ [package.dev-dependencies] dev = [ + { name = "anybadge" }, { name = "black" }, { name = "mypy" }, { name = "pylint" }, @@ -501,6 +514,7 @@ requires-dist = [ [package.metadata.requires-dev] dev = [ + { name = "anybadge", specifier = ">=1.14.0" }, { name = "black", specifier = ">=24.10.0" }, { name = "mypy", specifier = ">=1.14.0" }, { name = "pylint", specifier = ">=3.3.2" },