Skip to content

Commit

Permalink
ci: add a pylint badge
Browse files Browse the repository at this point in the history
Signed-off-by: Davide Madrisan <[email protected]>
  • Loading branch information
madrisan committed Dec 22, 2024
1 parent d89a81d commit 11f5071
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
23 changes: 23 additions & 0 deletions images/pylint.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions pylint.sh
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ dependencies = [

[dependency-groups]
dev = [
"anybadge>=1.14.0",
"black>=24.10.0",
"mypy>=1.14.0",
"pylint>=3.3.2",
Expand Down
14 changes: 14 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 11f5071

Please sign in to comment.