Skip to content

Commit

Permalink
(Feat) add YAML and JSON linter on github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
lbesnard committed Jun 3, 2024
1 parent 79e3a13 commit ad231f1
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 3 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Lint YAML and JSON

on:
push:
paths:
- '**/*.yml'
- '**/*.yaml'
- '**/*.json'
pull_request:
paths:
- '**/*.yml'
- '**/*.yaml'
- '**/*.json'

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code

Check failure on line 20 in .github/workflows/linter.yml

View workflow job for this annotation

GitHub Actions / lint

20:5 [indentation] wrong indentation: expected 6 but found 4

Check failure on line 20 in .github/workflows/linter.yml

View workflow job for this annotation

GitHub Actions / lint

20:5 [indentation] wrong indentation: expected 6 but found 4
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install linters
run: |
pip install yamllint
pip install jsonlint
- name: Lint YAML files
run: |
yamllint .
- name: Lint JSON files
run: |
find . -name '*.json' -exec jsonlint -q {} \;
- name: Display linter versions (Optional)
run: |
yamllint --version
jsonlint --version
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ See [documentation](README_add_new_dataset.md) to learn how to add a new dataset
# Notebooks

Notebooks exist under
https://github.com/aodn/architecturereview/blob/main/cloud-optimised/cloud-optimised-team/parquet/notebooks/
https://github.com/aodn/aodn_cloud_optimised/blob/main/notebooks/

For each new dataset, it is a good practice to use the provided template ```cloud-optimised/cloud-optimised-team/parquet/notebooks/template.ipynb```
For each new dataset, it is a good practice to use the provided template ```notebooks/template.ipynb```
and create a new notebook.

These notebooks use a common library of python functions to help with creating the geo-spatial filters:
```cloud-optimised/cloud-optimised-team/parquet/notebooks/parquet_queries.py```
```notebooks/parquet_queries.py```

0 comments on commit ad231f1

Please sign in to comment.