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

feat: add optional --fix-content-type TDE-859 #655

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
docs: update README
paulfouquet committed Sep 14, 2023
commit bd38ee53610aa1c37cd2a3eb58e80626fc8f2834
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ LINZ uses [Argo workflows](https://argoproj.github.io/workflows/) for running bu
- [create-manifest](#create-manifest)
- [group](#group)
- [list](#list)
- [pretty-print](#pretty-print)
- [format-json](#format-json)
- [stac catalog](#stac-catalog)
- [stac github-import](#stac-github-import)
- [stac sync](#stac-sync)
@@ -68,22 +68,22 @@ list s3://linz-imagery/sample --include ".*.tiff$" --group 10 --group-size 100MB
list s3://linz-imagery/sample --include ".*.tiff$" --exclude "BG33.tiff$" --output /tmp/list.json
```

### `pretty-print`
### `format-json`

Format all JSON files within a directory using `prettier`.
Format all JSON files within a directory using `prettier`. An optional flag `--fix-content-type` allows to set the content-type for s3 object with a value depending on the STAC object type.

#### Example

- Format and overwrite files:

```bash
pretty-print source/
format-json source/ [--fix-content-type]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come the name change? prettier will format a lot more than json. eg markdown, yaml, javascript etc..

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it's looking for json files atm. I can make the function more generic and look at other file format but I feel it will need a bit more work, specially around the --fix-content-type

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change to rename it, so Id prefer to leave it as is if we can?

```

- Create a copy of the formatted file in another flatten directory (testing only - does not handle duplicate filenames):

```bash
pretty-print source/ --target output/
format-json source/ --target output/
```

### `create-manifest`