From 7ea45d89db46a2616b69812f7cfc8a9767579c3d Mon Sep 17 00:00:00 2001 From: James Bourbeau Date: Tue, 5 Dec 2023 10:34:04 -0600 Subject: [PATCH] Add YAML formatting (prettier) (#398) --- .github/workflows/integration-test.yml | 2 +- .github/workflows/issue-manager.yml | 8 ++-- .github/workflows/test.yml | 2 +- .pre-commit-config.yaml | 35 ++++++++------- binder/environment-dev.yml | 24 +++++----- binder/environment.yml | 34 +++++++------- mkdocs.yml | 62 +++++++++++++------------- 7 files changed, 86 insertions(+), 81 deletions(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 8b6352c6..73ec2cef 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8, 3.9, '3.10', '3.11'] + python-version: [3.8, 3.9, "3.10", "3.11"] fail-fast: false steps: diff --git a/.github/workflows/issue-manager.yml b/.github/workflows/issue-manager.yml index 8a3e027a..2ddeab30 100644 --- a/.github/workflows/issue-manager.yml +++ b/.github/workflows/issue-manager.yml @@ -17,10 +17,10 @@ jobs: issue-manager: runs-on: "ubuntu-latest" steps: - - uses: "tiangolo/issue-manager@0.4.0" - with: - token: "${{ secrets.GITHUB_TOKEN }}" - config: > + - uses: "tiangolo/issue-manager@0.4.0" + with: + token: "${{ secrets.GITHUB_TOKEN }}" + config: > { "feedback requested": { "delay": 864000, diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 468417f1..640f9bfb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8, 3.9, '3.10', '3.11'] + python-version: [3.8, 3.9, "3.10", "3.11"] fail-fast: false steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 600c8027..a58408e8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,19 +1,24 @@ ci: - autoupdate_schedule: "monthly" # Like dependabot + autoupdate_schedule: "monthly" # Like dependabot autoupdate_commit_msg: "chore: update pre-commit hooks" - autofix_prs: false # Comment "pre-commit.ci autofix" on a PR to trigger + autofix_prs: false # Comment "pre-commit.ci autofix" on a PR to trigger repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.5.0 - hooks: - - id: check-yaml - - id: trailing-whitespace - - id: check-toml - - id: check-json -- repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.6 - hooks: - - id: ruff - args: ["--fix", "--exit-non-zero-on-fix"] - - id: ruff-format + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.5.0 + hooks: + - id: check-yaml + - id: trailing-whitespace + - id: check-toml + - id: check-json + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.6 + hooks: + - id: ruff + args: ["--fix", "--exit-non-zero-on-fix"] + - id: ruff-format + - repo: https://github.com/pre-commit/mirrors-prettier + rev: "v3.1.0" + hooks: + - id: prettier + types_or: [yaml] diff --git a/binder/environment-dev.yml b/binder/environment-dev.yml index 82e7eb22..202d825b 100644 --- a/binder/environment-dev.yml +++ b/binder/environment-dev.yml @@ -1,15 +1,15 @@ name: earthaccess-dev channels: -- conda-forge + - conda-forge dependencies: -# This environment bootstraps poetry, the actual dev environment -# is installed and managed with poetry -- python=3.9 -- jupyterlab=3 -- xarray>=0.19 -- ipyleaflet>=0.13 -- h5netcdf>=0.11 -- cartopy -- pip -- pip: - - poetry + # This environment bootstraps poetry, the actual dev environment + # is installed and managed with poetry + - python=3.9 + - jupyterlab=3 + - xarray>=0.19 + - ipyleaflet>=0.13 + - h5netcdf>=0.11 + - cartopy + - pip + - pip: + - poetry diff --git a/binder/environment.yml b/binder/environment.yml index cf0d2be4..2bc59969 100644 --- a/binder/environment.yml +++ b/binder/environment.yml @@ -1,20 +1,20 @@ name: earthaccess channels: -- conda-forge + - conda-forge dependencies: -- python=3.9 -- xarray>=0.19 -- dask>=2022.1 -- rioxarray>=0.3 -- matplotlib-base>=3.3 -- cartopy>=0.18.0 -- ipyleaflet>=0.15 -- netcdf4>=1.5 -- h5netcdf>=0.11 -- h5py>=3.2 -- geopandas>=0.9 -- zarr>=2.9.5 -- jupyterlab>=3 -- hvplot -- holoviews -- panel + - python=3.9 + - xarray>=0.19 + - dask>=2022.1 + - rioxarray>=0.3 + - matplotlib-base>=3.3 + - cartopy>=0.18.0 + - ipyleaflet>=0.15 + - netcdf4>=1.5 + - h5netcdf>=0.11 + - h5py>=3.2 + - geopandas>=0.9 + - zarr>=2.9.5 + - jupyterlab>=3 + - hvplot + - holoviews + - panel diff --git a/mkdocs.yml b/mkdocs.yml index 5b31db1a..c1905ba3 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -3,7 +3,7 @@ site_description: Client library for NASA Earthdata APIs site_url: https://github.com/nsidc/earthaccess theme: - name: 'material' + name: "material" logo: earth.png favicon: earth.png palette: @@ -19,7 +19,7 @@ theme: repo_name: nsidc/earthaccess repo_url: https://github.com/nsidc/earthaccess -edit_uri: '' +edit_uri: "" extra_css: - css/styles.css @@ -42,45 +42,45 @@ plugins: - mkdocs-jupyter: execute: True ignore: - - "tutorials/dask.ipynb" - - "**/.ipynb_checkpoints/*" + - "tutorials/dask.ipynb" + - "**/.ipynb_checkpoints/*" nav: - OVERVIEW: - - 'Readme': 'index.md' - - 'Getting started': 'tutorials/getting-started.ipynb' - - 'Resources' : 'resources.md' + - "Readme": "index.md" + - "Getting started": "tutorials/getting-started.ipynb" + - "Resources": "resources.md" - HOW-TO: - - 'Authenticate with Earthdata Login': 'howto/authenticate.md' - - 'Search NASA datasets using filters': 'howto/search-collections.md' - - 'Search for data using filters': 'howto/search-granules.md' - - 'Determine if a dataset is available in the cloud': 'howto/storage-location.md' - - 'Using authenticated sessions to access data': 'howto/edl.ipynb' - - 'Download data from on-prem location': 'howto/onprem.md' - - 'Direct S3 access - Open/stream files in the cloud': 'howto/cloud.md' + - "Authenticate with Earthdata Login": "howto/authenticate.md" + - "Search NASA datasets using filters": "howto/search-collections.md" + - "Search for data using filters": "howto/search-granules.md" + - "Determine if a dataset is available in the cloud": "howto/storage-location.md" + - "Using authenticated sessions to access data": "howto/edl.ipynb" + - "Download data from on-prem location": "howto/onprem.md" + - "Direct S3 access - Open/stream files in the cloud": "howto/cloud.md" - TUTORIALS: - - 'Accesing remote NASA data with fsspec': 'tutorials/file-access.ipynb' - - 'Search and access of restricted datasets': 'tutorials/restricted-datasets.ipynb' - - 'Reproducing NASA sea level rise infographic': 'tutorials/SSL.ipynb' - - 'Accessing and visualizing EMIT data with a few lines of code': 'tutorials/emit-earthaccess.ipynb' + - "Accesing remote NASA data with fsspec": "tutorials/file-access.ipynb" + - "Search and access of restricted datasets": "tutorials/restricted-datasets.ipynb" + - "Reproducing NASA sea level rise infographic": "tutorials/SSL.ipynb" + - "Accessing and visualizing EMIT data with a few lines of code": "tutorials/emit-earthaccess.ipynb" # - 'Distributing workloads with Dask clusters': 'tutorials/dask.ipynb' - USER REFERENCE: - API: - - 'Search and Access': 'user-reference/api/api.md' + - "Search and Access": "user-reference/api/api.md" - Modules: - - Collections: - - 'Collection Queries': 'user-reference/collections/collections-query.md' - - 'Collection Results': 'user-reference/collections/collections.md' - - Granules: - - 'Granule Queries': 'user-reference/granules/granules-query.md' - - 'Granule Results': 'user-reference/granules/granules.md' - - Store: - - 'Store': 'user-reference/store/store.md' - - Auth: - - 'Auth': 'user-reference/auth/auth.md' + - Collections: + - "Collection Queries": "user-reference/collections/collections-query.md" + - "Collection Results": "user-reference/collections/collections.md" + - Granules: + - "Granule Queries": "user-reference/granules/granules-query.md" + - "Granule Results": "user-reference/granules/granules.md" + - Store: + - "Store": "user-reference/store/store.md" + - Auth: + - "Auth": "user-reference/auth/auth.md" - Glossary: - - 'NASA Glossary': 'user-reference/glossary/nasa-glossary.md' - - 'Cloud Computing Terminology': 'user-reference/glossary/cloud-glossary.md' + - "NASA Glossary": "user-reference/glossary/nasa-glossary.md" + - "Cloud Computing Terminology": "user-reference/glossary/cloud-glossary.md" markdown_extensions: - admonition