Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce pre-commit github action workflow #46

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Code quality checks using pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
7 changes: 5 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -12,12 +12,15 @@ repos:
- id: check-toml
- id: pretty-format-json
args: ["--autofix", "--no-sort-keys"]
exclude_types: ["jupyter"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.8
rev: v0.6.9
hooks:
- id: ruff
args: [--fix]
exclude_types: ["jupyter"]
- id: ruff-format
exclude_types: ["jupyter"]
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
Expand Down
4 changes: 2 additions & 2 deletions openeo_udp_cost_profiling/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def get_job_cost_info(connection, job_id):
try:
job = connection.job(job_id).describe_job()
return float(job["costs"])
except:
except Exception:
return None


Expand Down Expand Up @@ -155,7 +155,7 @@ def plot_spatio_temporal_cost_profile(df):

# Plotting the heatmap using seaborn
plt.figure(figsize=(12, 8))
ax = sns.heatmap(
sns.heatmap(
job_cost_grid,
cmap=cmap,
norm=norm,
Expand Down
Loading