Skip to content

Commit cea6722

Browse files
authored
Merge branch 'main' into bbox=geometry
2 parents a444b8c + 2a9eab9 commit cea6722

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The format is (loosely) based on [Keep a Changelog](http://keepachangelog.com/)
1010

1111
- Added sponsors and supporters section with logos ([#122](https://github.com/stac-utils/stac-check/pull/122))
1212
- Added check to verify that bbox matches item's polygon geometry ([#123](https://github.com/stac-utils/stac-check/pull/123))
13+
- Added configuration documentation to README ([#124](https://github.com/stac-utils/stac-check/pull/124))
1314

1415
### Updated
1516

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The intent of this project is to provide a validation tool that also follows the
2525
- [Docker](#docker)
2626
- [Usage](#usage)
2727
- [CLI Usage](#cli-usage)
28+
- [Configuration](#configuration)
2829
- [Python API Usage](#python-api-usage)
2930
- [Examples](#examples)
3031
- [Basic Validation](#basic-validation)
@@ -88,6 +89,60 @@ Options:
8889
--help Show this message and exit.
8990
```
9091

92+
### Configuration
93+
94+
stac-check uses a configuration file to control which validation checks are performed. By default, it uses the built-in configuration at `stac_check/stac-check.config.yml`. You can customize the validation behavior by creating your own configuration file.
95+
96+
The configuration file has two main sections:
97+
98+
1. **linting**: Controls which best practices checks are enabled
99+
2. **settings**: Configures thresholds for certain checks
100+
101+
Here's an example of the configuration options:
102+
103+
```yaml
104+
linting:
105+
# Identifiers should consist of only lowercase characters, numbers, '_', and '-'
106+
searchable_identifiers: true
107+
# Item name should not contain ':' or '/'
108+
percent_encoded: true
109+
# Item file names should match their ids
110+
item_id_file_name: true
111+
# Collections and catalogs should be named collection.json and catalog.json
112+
catalog_id_file_name: true
113+
# A STAC collection should contain a summaries field
114+
check_summaries: true
115+
# Datetime fields should not be set to null
116+
null_datetime: true
117+
# Check unlocated items to make sure bbox field is not set
118+
check_unlocated: true
119+
# Check if bbox matches the bounds of the geometry
120+
check_bbox_geometry_match: true
121+
# Check to see if there are too many links
122+
bloated_links: true
123+
# Check for bloated metadata in properties
124+
bloated_metadata: true
125+
# Ensure thumbnail is a small file size ["png", "jpeg", "jpg", "webp"]
126+
check_thumbnail: true
127+
# Ensure that links in catalogs and collections include a title field
128+
links_title: true
129+
# Ensure that links in catalogs and collections include self link
130+
links_self: true
131+
132+
settings:
133+
# Number of links before the bloated links warning is shown
134+
max_links: 20
135+
# Number of properties before the bloated metadata warning is shown
136+
max_properties: 20
137+
```
138+
139+
To use a custom configuration file, set the `STAC_CHECK_CONFIG` environment variable to the path of your configuration file:
140+
141+
```bash
142+
export STAC_CHECK_CONFIG=/path/to/your/config.yml
143+
stac-check sample_files/1.0.0/core-item.json
144+
```
145+
91146
### Python API Usage
92147

93148
```python

0 commit comments

Comments
 (0)