Skip to content

Commit e8a6faa

Browse files
authored
Merge pull request #5 from madrisan/pylint-workflow
ci: add a job running pylint
2 parents 8c31f68 + 5028bca commit e8a6faa

File tree

6 files changed

+71
-3
lines changed

6 files changed

+71
-3
lines changed

.github/workflows/ci.yaml

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: lint
22
on: [push, pull_request]
33
jobs:
4-
run-linters:
5-
name: Run linters
4+
ci:
5+
name: Run black and pylint tools
66
runs-on: ubuntu-latest
77

88
steps:
@@ -12,7 +12,12 @@ jobs:
1212
- name: Set up Python
1313
uses: actions/setup-python@v1
1414
with:
15-
python-version: 3.8
15+
python-version: 3.12
16+
17+
- name: Install the latest version of uv
18+
uses: astral-sh/setup-uv@v4
19+
with:
20+
version: "latest"
1621

1722
- name: Install Python dependencies
1823
run: pip install black flake8
@@ -23,3 +28,7 @@ jobs:
2328
auto_fix: false
2429
black: true
2530
flake8: false
31+
32+
- name: Analysing the code with pylint
33+
run: |
34+
uv run pylint --output-format=text ./**/*.py

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Visualize the HadCRUT5 temperature datasets
22

3+
![Release Status](https://img.shields.io/badge/status-stable-brightgreen.svg)
4+
![Pylint](images/pylint.svg)
5+
[![License](https://img.shields.io/badge/License-GPL--3.0-blue.svg)](https://spdx.org/licenses/GPL-3.0-only.html)
6+
[![GitHub stars](https://img.shields.io/github/stars/madrisan/HadCRUT5.svg?style=social)](https://github.com/madrisan/HadCRUT5/stargazers)
7+
38
> HadCRUT5 is a gridded dataset of global historical surface temperature anomalies relative to a 1961-1990 reference period.
49
> Data are available for each month from January 1850 onwards, on a 5 degree grid and as global and regional average time series.
510
> The dataset is a collaborative product of the Met Office Hadley Centre and the Climatic Research Unit at the University of East Anglia.

images/pylint.svg

+23
Loading

pylint.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
uv run pylint \
2+
--verbose \
3+
--output-format=text ./**/*.py \
4+
| tee pylint-log.txt
5+
6+
score="$(
7+
sed -n "/^Your code has been rated at/{s,.* at \([0-9\.]*\)\/.*,\1,p}" \
8+
pylint-log.txt)"
9+
10+
uv run anybadge \
11+
--file="images/pylint.svg" \
12+
--label "pylint" \
13+
--overwrite \
14+
--value "$score"
15+
16+
rm -f pylint-log.txt

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ dependencies = [
1313

1414
[dependency-groups]
1515
dev = [
16+
"anybadge>=1.14.0",
1617
"black>=24.10.0",
1718
"mypy>=1.14.0",
1819
"pylint>=3.3.2",

uv.lock

+14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)