Skip to content

Commit

Permalink
Add prettier precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiggi committed May 21, 2024
1 parent d044fee commit 9b4182c
Show file tree
Hide file tree
Showing 18 changed files with 200 additions and 191 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: 🐞 Bug Report
description: File a bug/issue
title: '[BUG] <title>'
title: "[BUG] <title>"
labels: [bug, triage]
assignees: ghiggi
body:
Expand Down
4 changes: 2 additions & 2 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yaml-file
version: 2
updates:
- package-ecosystem: github-actions # See documentation for possible values
directory: / # Location of package manifests
- package-ecosystem: github-actions # See documentation for possible values
directory: / # Location of package manifests
schedule:
interval: monthly
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: "3.8"
- name: Ruff
if: success() || failure()
uses: pre-commit/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release_to_pypi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ jobs:
dist/${{ env.asset_name }}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
token: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
9 changes: 5 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: Tests
on: [push, pull_request, workflow_dispatch]
jobs:
tests:
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}${{ matrix.experimental && ', latest
name:
Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}${{ matrix.experimental && ', latest
dependencies' || '' }}
runs-on: ${{ matrix.os }}
defaults:
Expand All @@ -13,14 +14,14 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.9', '3.10', '3.11']
python-version: ["3.9", "3.10", "3.11"]
experimental: [false]
include:
- os: ubuntu-latest
python-version: '3.11'
python-version: "3.11"
experimental: true
- os: ubuntu-latest
python-version: '3.11'
python-version: "3.11"
experimental: false
coverage: true
steps:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/tests_windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ name: Tests Windows
on: [push, pull_request, workflow_dispatch]
jobs:
tests:
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}${{ matrix.experimental && ' with
name:
Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}${{ matrix.experimental && ' with
latest dependencies' || '' }}
runs-on: ${{ matrix.os }}
defaults:
Expand All @@ -13,7 +14,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
python-version: ['3.9', '3.10', '3.11']
python-version: ["3.9", "3.10", "3.11"]
experimental: [false]
steps:
- uses: actions/checkout@v4
Expand Down
19 changes: 10 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@ repos:
rev: v0.3.9
hooks:
- id: blackdoc
additional_dependencies: ['black[jupyter]']
additional_dependencies: ["black[jupyter]"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
hooks:
- id: prettier
types_or: [yaml, html, css, scss, javascript, json] # markdown to avoid conflicts with mdformat
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
Expand All @@ -39,14 +44,14 @@ repos:
- repo: https://github.com/MarcoGorelli/madforhooks
rev: 0.4.1
hooks:
- id: conda-env-sorter
# - id: conda-env-sorter # conflicts with prettier
- id: check-execution-order
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
additional_dependencies: [mdformat-gfm, mdformat-black]
exclude: ^.github/ # this avoid the hook to wrongly reformats md issue template files
exclude: ^.github/ # this avoid the hook to wrongly reformats md issue template files
- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
hooks:
Expand All @@ -57,18 +62,14 @@ repos:
hooks:
- id: nbqa-black
- id: nbqa-ruff
args: [--fix, '--ignore=E402,B018']
args: [--fix, "--ignore=E402,B018"]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
hooks:
- id: rst-backticks
- id: rst-directive-colons
- id: rst-inline-touching-normal
# - repo: https://github.com/pre-commit/mirrors-prettier
# rev: "v3.1.0"
# hooks:
# - id: prettier
# types_or: [yaml, markdown, html, css, scss, javascript, json]

# - repo: https://github.com/adrienverge/yamllint.git
# rev: v1.35.1
# hooks:
Expand Down
62 changes: 31 additions & 31 deletions ci/environment.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
name: gpm_api
channels: [conda-forge]
dependencies:
- cartopy>=0.22.0
- click
- dask
- deepdiff
- distributed
- donfig
- h5py
- jupyter
- matplotlib>=3.8.3
- netcdf4
- polars
- pyarrow
- pycolorbar
- pyproj
- pyresample
- pytest
- pytest-cov
- pytest-mock
- pytest-sugar
- pyvista
- pyvista
- scipy
- shapely
- tqdm
- trame
- trame-vtk
- trame-vuetify
- trollsift
- xarray-datatree
- xarray<=2024.2.0
- ximage
- cartopy>=0.22.0
- click
- dask
- deepdiff
- distributed
- donfig
- h5py
- jupyter
- matplotlib>=3.8.3
- netcdf4
- polars
- pyarrow
- pycolorbar
- pyproj
- pyresample
- pytest
- pytest-cov
- pytest-mock
- pytest-sugar
- pyvista
- pyvista
- scipy
- shapely
- tqdm
- trame
- trame-vtk
- trame-vuetify
- trollsift
- xarray-datatree
- xarray<=2024.2.0
- ximage
62 changes: 31 additions & 31 deletions ci/environment_latest.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
name: gpm_api
channels: [conda-forge]
dependencies:
- cartopy
- click
- dask
- deepdiff
- distributed
- donfig
- h5py
- jupyter
- matplotlib
- netcdf4
- polars
- pyarrow
- pycolorbar
- pyproj
- pyresample
- pytest
- pytest-cov
- pytest-mock
- pytest-sugar
- pyvista
- pyvista
- scipy
- shapely
- tqdm
- trame
- trame-vtk
- trame-vuetify
- trollsift
- xarray
- xarray-datatree
- ximage
- cartopy
- click
- dask
- deepdiff
- distributed
- donfig
- h5py
- jupyter
- matplotlib
- netcdf4
- polars
- pyarrow
- pycolorbar
- pyproj
- pyresample
- pytest
- pytest-cov
- pytest-mock
- pytest-sugar
- pyvista
- pyvista
- scipy
- shapely
- tqdm
- trame
- trame-vtk
- trame-vuetify
- trollsift
- xarray
- xarray-datatree
- ximage
32 changes: 16 additions & 16 deletions docs/environment.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: build-doc-gpm-api
channels: [conda-forge]
dependencies:
- docutils
- gpm-api
- jupyter
- nbsphinx==0.9.3
- pandoc
- pip
- polars
- python>=3.9
- pyvista
- sphinx-book-theme==1.1.0
- sphinx-gallery
- sphinx-mdinclude==0.5.3
- sphinx==7.2.6
- sphinxcontrib-youtube
- ximage
- pip: [pycolorbar]
- docutils
- gpm-api
- jupyter
- nbsphinx==0.9.3
- pandoc
- pip
- polars
- python>=3.9
- pyvista
- sphinx-book-theme==1.1.0
- sphinx-gallery
- sphinx-mdinclude==0.5.3
- sphinx==7.2.6
- sphinxcontrib-youtube
- ximage
- pip: [pycolorbar]
4 changes: 2 additions & 2 deletions gpm/etc/colorbars/IMERG_colorbars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ IMERG_Solid:
name: IMERG_Solid
bad_alpha: 0.5
bad_color: gray
over_color: '#8c149c'
over_color: "#8c149c"
under_color: none
norm:
name: BoundaryNorm
Expand All @@ -163,7 +163,7 @@ IMERG_Liquid:
name: IMERG_Liquid
bad_alpha: 0.5
bad_color: gray
over_color: '#910000'
over_color: "#910000"
under_color: none
norm:
name: BoundaryNorm
Expand Down
20 changes: 10 additions & 10 deletions gpm/etc/colormaps/precipitation/IMERG_Liquid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
colormap_type: LinearSegmentedColormap
color_space: hex
color_palette:
- '#008114'
- '#008b52'
- '#00b330'
- '#60d300'
- '#b4e700'
- '#fffb00'
- '#ffc400'
- '#ff9300'
- '#ff0000'
- '#c80000'
- "#008114"
- "#008b52"
- "#00b330"
- "#60d300"
- "#b4e700"
- "#fffb00"
- "#ffc400"
- "#ff9300"
- "#ff0000"
- "#c80000"
auxiliary:
category: [IMERG, GPM, precipitation, rainfall]
20 changes: 10 additions & 10 deletions gpm/etc/colormaps/precipitation/IMERG_Solid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
colormap_type: LinearSegmentedColormap
color_space: hex
color_palette:
- '#45ffff'
- '#49ddff'
- '#4dbbff'
- '#4f9aff'
- '#517aff'
- '#525dff'
- '#5346ff'
- '#5a2fd9'
- '#7321bb'
- '#8c149c'
- "#45ffff"
- "#49ddff"
- "#4dbbff"
- "#4f9aff"
- "#517aff"
- "#525dff"
- "#5346ff"
- "#5a2fd9"
- "#7321bb"
- "#8c149c"
auxiliary:
category: [IMERG, GPM, precipitation, snowfall]
Loading

0 comments on commit 9b4182c

Please sign in to comment.