Skip to content

Commit

Permalink
Format all the YAMLs (#2066)
Browse files Browse the repository at this point in the history
And keep them formatted with a pre-commit hook.
In the default hooks there was already a check-yaml but that only
verifies the syntax.
Uses https://github.com/google/yamlfmt.
  • Loading branch information
visr authored Feb 14, 2025
1 parent cceff6e commit 6e07ef8
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 35 deletions.
1 change: 0 additions & 1 deletion .docker/compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
version: '2'

services:
qgis:
image: qgis/qgis:release-3_34
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,10 @@ jobs:
pixi-version: "latest"
- name: Prepare pixi
run: pixi run install-ci

- name: Check Quarto installation and all engines
run: pixi run quarto-check

- name: Render Quarto Project
run: pixi run quarto-render

- name: Publish Quarto Project
if: github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/julia_auto_update.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: Julia auto update

on:
schedule:
# At 03:00 on day 2 of the month
# At 03:00 on day 2 of the month
- cron: "0 3 2 * *"
# on demand
workflow_dispatch:

jobs:
auto-update:
runs-on: ubuntu-latest
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/pixi_auto_update.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
name: Update Pixi lockfile

permissions:
contents: write
pull-requests: write

on:
schedule:
# At 03:00 on day 3 of the month
# At 03:00 on day 3 of the month
- cron: "0 3 3 * *"
# on demand
workflow_dispatch:

jobs:
pixi-update:
runs-on: ubuntu-latest
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/pre-commit_auto_update.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: Pre-commit auto update

on:
schedule:
# At 03:00 on day 1 of the month
# At 03:00 on day 1 of the month
- cron: "0 3 1 * *"
# on demand
workflow_dispatch:

jobs:
auto-update:
runs-on: ubuntu-latest
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pre-commit_check.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: Pre-commit

on:
pull_request:
merge_group:
push:
branches: [main, update/pre-commit-hooks, update/pixi-lock]
workflow_dispatch:

jobs:
check:
runs-on: ubuntu-latest
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/qgis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: QGIS Tests

on:
push:
branches: [main]
Expand Down
7 changes: 5 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ repos:
- id: check-toml
- id: check-merge-conflict
- id: check-vcs-permalinks
-
id: end-of-file-fixer
- id: end-of-file-fixer
exclude: '.teamcity'
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
Expand All @@ -20,6 +19,10 @@ repos:
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
types_or: [python, pyi, jupyter]
- repo: https://github.com/google/yamlfmt
rev: v0.16.0
hooks:
- id: yamlfmt
- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
hooks:
Expand Down
1 change: 0 additions & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ coverage:
patch:
default:
informational: true

project:
default:
informational: true
21 changes: 6 additions & 15 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ website:
- icon: github
href: https://github.com/Deltares/Ribasim
aria-label: GitHub

sidebar:
- title: "Overview"
contents:
Expand All @@ -33,35 +32,31 @@ website:
- changelog.qmd
- known_issues.qmd
- contact.qmd

- title: "Tutorials"
contents:
- tutorial/natural-flow.ipynb
- tutorial/irrigation-demand.ipynb
- tutorial/reservoir.ipynb

- title: "How-to guides"
contents:
- guide/examples.ipynb
- guide/qgis.qmd
- guide/coupling.qmd
- section: "Coupling guides"
contents:
- guide/delwaq.ipynb

- guide/delwaq.ipynb
- title: "Concepts"
contents:
- concept/concept.qmd
- section: "Numerics"
contents:
- concept/modelconcept.qmd
- concept/equations.qmd
- concept/numerics.qmd
- concept/modelconcept.qmd
- concept/equations.qmd
- concept/numerics.qmd
- section: "Implementation"
contents:
- concept/core.qmd
- concept/allocation.qmd

- concept/core.qmd
- concept/allocation.qmd
- title: "Reference"
contents:
- reference/index.qmd
Expand All @@ -86,7 +81,6 @@ website:
- reference/node/discrete-control.qmd
- reference/node/continuous-control.qmd
- reference/node/pid-control.qmd

- title: "Contributing"
contents:
- dev/index.qmd
Expand All @@ -103,16 +97,13 @@ website:
contents:
- dev/qgis.qmd
- dev/qgis_test_plan.qmd

format:
html:
theme: cosmo
css: assets/styles.css
toc: true

bibliography: references.bib
number-sections: true

quartodoc:
style: pkgdown
dir: reference/python
Expand Down
3 changes: 3 additions & 0 deletions yamlfmt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://github.com/google/yamlfmt/blob/main/docs/config-file.md
gitignore_excludes: true
line_ending: lf

0 comments on commit 6e07ef8

Please sign in to comment.